public JsonResult CreateFull([FromBody] VAsnDetails vAsn) { var r = asnService.CreateFull(vAsn); var response = new JsonResult(r); return(response); }
public bool CreateFull(VAsnDetails vAsn) { var o = new TInAsn { Code = DateTime.Now.ToString(FormatString.DefaultFormat), RefCode = DateTime.Now.ToString(FormatString.DefaultFormat), WhId = vAsn.Asn.WhId, CustId = vAsn.Asn.CustId, BrandId = vAsn.Asn.BrandId, BatchNo = vAsn.Asn.BatchNo ?? DateTime.Now.ToString("yyyyMMdd"), BizCode = vAsn.Asn.BizCode, GoodsType = vAsn.Asn.GoodsType, TypeCode = "Asn", TransCode = "Inbound", SrcCode = "Interface", IsCiq = false, Status = "None", CheckStatus = "None", IsDeleted = false, CreatedBy = "rickli", CreatedTime = DateTime.UtcNow }; var ds = new List <TInAsnD>(); foreach (var d in vAsn.AsnDs) { var n = new TInAsnD { Sku = d.Sku, Barcode = d.Barcode, Qty = d.Qty, IsDeleted = false, CreatedBy = "rickli", CreatedTime = DateTime.UtcNow, }; ds.Add(n); o.DetailList.Add(n); } wms.TInAsns.Add(o); return(wms.SaveChanges() > 0); }