public void FindDetail(int LedgerId) { JournalDetail pod = JDetails.Where(x => x.LedgerId == LedgerId).FirstOrDefault(); if (pod != null) { pod.toCopy <JournalDetail>(JDetail); } }
public void DeleteDetail(int LedgerId) { JournalDetail pod = JDetails.Where(x => x.LedgerId == LedgerId).FirstOrDefault(); if (pod != null) { JDetails.Remove(pod); Amount = JDetails.Sum(x => x.DrAmt) - JDetails.Sum(x => x.CrAmt); } }
public void SaveDetail() { JournalDetail pod = JDetails.Where(x => x.LedgerId == JDetail.LedgerId).FirstOrDefault(); if (pod == null) { pod = new JournalDetail(); JDetails.Add(pod); } JDetail.toCopy <JournalDetail>(pod); ClearDetail(); Amount = JDetails.Sum(x => x.DrAmt) - JDetails.Sum(x => x.CrAmt); }