45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using Dapper;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace NX.ERP.U8.Store
|
|
{
|
|
public class StockDAL
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="strwhere"></param>
|
|
/// <param name="Params"></param>
|
|
/// <returns></returns>
|
|
public IEnumerable<Model.Response.Store.Stock> GetList(string strwhere = "", object Params = null)
|
|
{
|
|
using (var conn = U8LoginContext.Instance.Connection)
|
|
{
|
|
var sql = @"select cInvCode as MaterialCode ,cPosCode as BinCode,iQuantity as Qty from InvPositionSum where ISNULL(iQuantity,0)<>0";
|
|
if (!string.IsNullOrEmpty(strwhere))
|
|
{
|
|
sql += $" and {strwhere}";
|
|
}
|
|
return conn.Query<Model.Response.Store.Stock>(sql, Params);
|
|
}
|
|
}
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="Code"></param>
|
|
/// <returns></returns>
|
|
public IEnumerable<Model.Response.Store.Stock> GetListByMaterialCode(string Code)
|
|
{
|
|
return this.GetList(" cInvCode like @Code", new { Code = $"%{Code}%" });
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|