public void DeleteDetail(int LedgerId) { PaymentDetail pod = PDetails.Where(x => x.LedgerId == LedgerId).FirstOrDefault(); if (pod != null) { PDetails.Remove(pod); Amount = PDetails.Sum(x => x.Amount); } }
public void DeleteDetail(string PName) { PurchaseDetail pod = PDetails.Where(x => x.ProductName == PName).FirstOrDefault(); if (pod != null) { PDetails.Remove(pod); ItemAmount = PDetails.Sum(x => x.Amount); } }