public FDIPostWOClose GetFDIPostWOCloseById(string Id) { using (IFDIPostWOCloseBLL FDIPostWOCloseBLL = BLLContainer.Resolve <IFDIPostWOCloseBLL>()) { FDIPostWOClose model = FDIPostWOCloseBLL.GetFirstOrDefault(Id); return(model); } }
public bool AddFDIPostWOClose(FDIPostWOClose mFDIPostWOClose) { if (mFDIPostWOClose == null) { return(false); } using (IFDIPostWOCloseBLL FDIPostWOCloseBLL = BLLContainer.Resolve <IFDIPostWOCloseBLL>()) { return(FDIPostWOCloseBLL.Add(mFDIPostWOClose)); } }
public bool DelFDIPostWOClose(string Id) { using (IFDIPostWOCloseBLL FDIPostWOCloseBLL = BLLContainer.Resolve <IFDIPostWOCloseBLL>()) { try { FDIPostWOClose item = FDIPostWOCloseBLL.GetFirstOrDefault(Id); return(FDIPostWOCloseBLL.Delete(item)); } catch { return(false); } } }
public bool DelFDIPostWOCloses(string[] Ids) { using (IFDIPostWOCloseBLL FDIPostWOCloseBLL = BLLContainer.Resolve <IFDIPostWOCloseBLL>()) { try { List <FDIPostWOClose> entitys = new List <FDIPostWOClose>(); foreach (string id in Ids) { FDIPostWOClose item = FDIPostWOCloseBLL.GetFirstOrDefault(id); entitys.Add(item); } return(FDIPostWOCloseBLL.Delete(entitys)); } catch { return(false); } } }
public string PostWOClose() { NetLog.Write("GetRawMaterial" + " "); var oldBatchs = GetFDIPostWOCloseBatchs(""); List <FDIPostWOCloseBatch> Batchs = new List <FDIPostWOCloseBatch>(); var oldDetails = GetFDIPostWOCloseDetails(""); var oldMains = GetFDIPostWOCloses(""); List <FDIPostWOClose> Mains = new List <FDIPostWOClose>(); foreach (var m in oldMains) { FDIPostWOClose main = new FDIPostWOClose(); main.CopyDataItem(m); main.Details = new List <FDIPostWOCloseDetail>(); foreach (var d in oldDetails.Where(c => c.DocEntry == m.Docentry)) { FDIPostWOCloseDetail detial = new FDIPostWOCloseDetail(); detial.CopyDataItem(d); detial.Batchs = new List <FDIPostWOCloseBatch>(); foreach (var b in oldBatchs.Where(c => c.DocEntry == m.Docentry && c.LineNum == d.LineNum)) { FDIPostWOCloseBatch batch = new FDIPostWOCloseBatch(); batch.CopyDataItem(b); detial.Batchs.Add(batch); } main.Details.Add(detial); } Mains.Add(main); } string jsonText = SafeConverter.JsonSerializeObject(Mains); return(jsonText); }