Files
U8-Import/NX.ERP.BLL/Store/SotreIn.cs

98 lines
3.3 KiB
C#
Raw Normal View History

2021-01-21 13:42:23 +08:00
using NX.ERP.BLL.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Store
{
public class SotreIn
{
public StoreResult AddVoucher(Model.Inbound inbound)
{
var deptCode = "52";
string ID = "";
2021-01-22 09:19:51 +08:00
if (inbound.InboundType == Model.InboundType.PurchaseIn)
2021-01-21 13:42:23 +08:00
{
var dal = new NX.ERP.U8.Store.PuStoreInDAL();
ID = dal.AddVocher(new ERP.Model.Request.PuStoreIn()
{
2021-01-22 11:25:03 +08:00
Code = "190700000050",
2021-01-21 13:42:23 +08:00
Date = inbound.InboundDate,
Source = inbound.SourceName,
SourceCode = inbound.SourceNo,
Whcode = inbound.WarehouseCode,
Deptcode = deptCode,
Maker = inbound.Maker,
Details = inbound.InboundDtlLst.ToList().ConvertAll(m =>
{
return new ERP.Model.Request.PuStoreInDetail()
{
Invcode = m.MaterialCode,
SorceDetailId = m.SourceDtlId,
Position = m.BinCode,
Quantity = m.Qty
};
})
});
}
if (inbound.InboundType == Model.InboundType.PurchaseIn)
{
var dal = new NX.ERP.U8.Store.ProductInDAL();
ID = dal.AddVoucher(new ERP.Model.Request.ProductStoreIn()
{
2021-01-22 11:25:03 +08:00
Code= "19100002",
2021-01-21 13:42:23 +08:00
Date = inbound.InboundDate,
Source = inbound.SourceName,
SourceCode = inbound.SourceNo,
WhCode = inbound.WarehouseCode,
Deptcode = deptCode,
Maker = inbound.Maker,
Details = inbound.InboundDtlLst.ToList().ConvertAll(m =>
{
return new ERP.Model.Request.ProductStoreInDetail()
{
Batch = "",
InvCode = m.MaterialCode,
SourceDetailId = m.SourceDtlId,
Position = m.BinCode,
Quantity = m.Qty
};
})
});
}
if (inbound.InboundType == Model.InboundType.OtherIn)
{
var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
ID = dal.AddVocher(new ERP.Model.Request.OtherStoreInOut()
{
2021-01-22 11:25:03 +08:00
Code= "19100028",
2021-01-21 13:42:23 +08:00
Date = inbound.InboundDate,
WhCode = inbound.WarehouseCode,
Maker = inbound.Maker,
details = inbound.InboundDtlLst.ToList().ConvertAll(m =>
{
return new ERP.Model.Request.OtherStoreInOutDetail()
{
InvCode = m.MaterialCode,
Position = m.BinCode,
Quantity = m.Qty
};
})
});
}
return new StoreResult() { ID = int.Parse( ID) };
}
}
}