public async Task <ActionResult <PDetails> > PostPDetails(PDetails pDetails) { _context.PDetails.Add(pDetails); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPDetails", new { id = pDetails.PId }, pDetails)); }
public async Task <IActionResult> PutPDetails(int id, PDetails pDetails) { if (id != pDetails.PId) { return(BadRequest()); } _context.Entry(pDetails).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PDetailsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void FindDetail(int LedgerId) { PaymentDetail pod = PDetails.Where(x => x.LedgerId == LedgerId).FirstOrDefault(); if (pod != null) { pod.toCopy <PaymentDetail>(PDetail); } }
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); } }
public void SaveDetail() { PaymentDetail pod = PDetails.Where(x => x.LedgerId == PDetail.LedgerId).FirstOrDefault(); if (pod == null) { pod = new PaymentDetail(); PDetails.Add(pod); } PDetail.toCopy <PaymentDetail>(pod); ClearDetail(); Amount = PDetails.Sum(x => x.Amount); }
public void SaveDetail() { if (PDetail.ProductId != 0) { PurchaseDetail pod = PDetails.Where(x => x.ProductId == PDetail.ProductId).FirstOrDefault(); if (pod == null) { pod = new PurchaseDetail(); PDetails.Add(pod); } else { PDetail.Quantity += pod.Quantity; } PDetail.toCopy <PurchaseDetail>(pod); ClearDetail(); ItemAmount = PDetails.Sum(x => x.Amount); } }