public FDIPostSaleOrder GetFDIPostSaleOrderById(string Id) { using (IFDIPostSaleOrderBLL FDIPostSaleOrderBLL = BLLContainer.Resolve <IFDIPostSaleOrderBLL>()) { FDIPostSaleOrder model = FDIPostSaleOrderBLL.GetFirstOrDefault(Id); return(model); } }
public bool AddFDIPostSaleOrder(FDIPostSaleOrder mFDIPostSaleOrder) { if (mFDIPostSaleOrder == null) { return(false); } using (IFDIPostSaleOrderBLL FDIPostSaleOrderBLL = BLLContainer.Resolve <IFDIPostSaleOrderBLL>()) { return(FDIPostSaleOrderBLL.Add(mFDIPostSaleOrder)); } }
public bool DelFDIPostSaleOrder(string Id) { using (IFDIPostSaleOrderBLL FDIPostSaleOrderBLL = BLLContainer.Resolve <IFDIPostSaleOrderBLL>()) { try { FDIPostSaleOrder item = FDIPostSaleOrderBLL.GetFirstOrDefault(Id); return(FDIPostSaleOrderBLL.Delete(item)); } catch { return(false); } } }
public bool DelFDIPostSaleOrders(string[] Ids) { using (IFDIPostSaleOrderBLL FDIPostSaleOrderBLL = BLLContainer.Resolve <IFDIPostSaleOrderBLL>()) { try { List <FDIPostSaleOrder> entitys = new List <FDIPostSaleOrder>(); foreach (string id in Ids) { FDIPostSaleOrder item = FDIPostSaleOrderBLL.GetFirstOrDefault(id); entitys.Add(item); } return(FDIPostSaleOrderBLL.Delete(entitys)); } catch { return(false); } } }
public string PostDNOrder() { NetLog.Write("MES回传SAP销售发货单" + " "); var oldBatchs = GetFDIPostSaleOrderBatchs(""); List <FDIPostSaleOrderBatch> Batchs = new List <FDIPostSaleOrderBatch>(); var oldDetails = GetFDIPostSaleOrderDetails(""); var oldMains = GetFDIPostSaleOrders("Flag_In = 0"); List <FDIPostSaleOrder> Mains = new List <FDIPostSaleOrder>(); foreach (var m in oldMains) { FDIPostSaleOrder main = new FDIPostSaleOrder(); main.CopyDataItem(m); main.Details = new List <FDIPostSaleOrderDetail>(); foreach (var d in oldDetails.Where(c => c.DocEntry == m.DocEntry)) { FDIPostSaleOrderDetail detail = new FDIPostSaleOrderDetail(); detail.CopyDataItem(d); main.Details.Add(detail); detail.Batchs = new List <FDIPostSaleOrderBatch>(); foreach (var b in oldBatchs.Where(c => c.DocEntry == m.DocEntry && c.LineNum == d.LineId)) { FDIPostSaleOrderBatch batch = new FDIPostSaleOrderBatch(); batch.CopyDataItem(b); detail.Batchs.Add(batch); } } Mains.Add(main); } string jsonText = SafeConverter.JsonSerializeObject(Mains); return(jsonText); }