发货单
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
<Compile Include="FormatHelp.cs" />
|
||||
<Compile Include="Mom\MomOrderDAL.cs" />
|
||||
<Compile Include="Purchase\ArrivalDAL.cs" />
|
||||
<Compile Include="Sale\DispatchListDAL.cs" />
|
||||
<Compile Include="Store\MaterielStoreOutDAL.cs" />
|
||||
<Compile Include="Store\OtherStoreInDAL.cs" />
|
||||
<Compile Include="Store\OtherStoreOutDAL.cs" />
|
||||
|
||||
74
NX.ERP.U8/Sale/DispatchListDAL.cs
Normal file
74
NX.ERP.U8/Sale/DispatchListDAL.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Dapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.U8.Sale
|
||||
{
|
||||
public class DispatchListDAL
|
||||
{
|
||||
public IEnumerable<Model.Sale.DispatchList> GetList(string strWhere = "", object Params = null)
|
||||
{
|
||||
var strSql = @"select a.DLID as id ,a.cDLCode as Code ,b.AutoID as id ,b.cInvCode as InvCode ,b.cInvName as InvName,b.iQuantity AS Quantity
|
||||
from DispatchList as a
|
||||
left join DispatchLists as b on a.DLID = b.DLID";
|
||||
|
||||
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
|
||||
{
|
||||
var lookup = new Dictionary<int, Model.Sale.DispatchList>();
|
||||
// return conn.Query<Model.Purchase.Arrival>(strSQL,null);
|
||||
var list = conn.Query<NX.ERP.Model.Sale.DispatchList, NX.ERP.Model.Sale.DispatchListDetail, NX.ERP.Model.Sale.DispatchList>(strSql, (Dispatch, DispatchDetail) =>
|
||||
{
|
||||
if (!lookup.TryGetValue(Dispatch.ID, out var _Dispatch))
|
||||
{
|
||||
lookup.Add(Dispatch.ID, Dispatch);
|
||||
}
|
||||
else
|
||||
{
|
||||
Dispatch = _Dispatch;
|
||||
}
|
||||
|
||||
Dispatch.Details.Add(DispatchDetail);
|
||||
return Dispatch;
|
||||
}, Params, null, true, "id", 10, System.Data.CommandType.Text);
|
||||
return lookup.Values;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Model.Sale.DispatchList GetModel(int id)
|
||||
{
|
||||
return this.GetList(" a.cDLCode=@id", new { id }).FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Model.Sale.DispatchList GetModel(string Code)
|
||||
{
|
||||
return this.GetList(" a.DLID=@Code", new { Code }).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<Model.Sale.DispatchList> GetListByLastID(int ID)
|
||||
{
|
||||
return this.GetList(" a.DLID>=@ID ", new { ID });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,12 +8,15 @@ namespace NX.ERP.U8.Store
|
||||
public class SaleOutDAL : VoucherBase
|
||||
{
|
||||
public SaleOutDAL() : base("32", "U8API/saleout")
|
||||
{
|
||||
|
||||
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public string AddVoucher()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user