public ActionResult Approve(int id) { Invoice invoice = _db.Invoices.Find(id); invoice.InvoiceStatus = 2; _db.Entry(invoice).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Invoice invoice) { Initialize(); if (ModelState.IsValid) { invoice.EmployeePUID = _employeepuid; invoice.CompanyDomain = _domain; _db.Entry(invoice).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(invoice)); }
public ActionResult Edit(Item item) { var invoice = from k in _db.Invoices from t in k.Items where t.ItemID == item.ItemID select k; if (ModelState.IsValid) { _db.Entry(item).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Details", "Invoice", new { id = invoice.First().InvoiceID })); } return(View(item)); }