public ActionResult DeleteConfirmed(int id) { SupplierPaymentList supplierPaymentList = db.SupplierPaymentLists.Find(id); var y = supplierPaymentList.SupplierId; db.SupplierPaymentLists.Remove(supplierPaymentList); db.SaveChanges(); return(RedirectToAction("Index", "SupplierPayment", new { id = y })); }
public ActionResult Create([Bind(Include = "Id,Income,Expense,Description")] SupplierPaymentList supplierPaymentList, int id) { if (ModelState.IsValid) { supplierPaymentList.SupplierDate = DateTime.Now; supplierPaymentList.SupplierId = id; db.SupplierPaymentLists.Add(supplierPaymentList); db.SaveChanges(); return(RedirectToAction("Index", "Supplier")); } return(View(supplierPaymentList)); }