public ActionResult Submit(int invoiceId, Manager item) { Initialize(); var invoices = _db.Invoices.Single(r => r.InvoiceID == invoiceId); item.ManagerPUID = _managerPuid; item.ManagerName = _managerName; if (ModelState.IsValid) { invoices.InvoiceStatus = 1; invoices.CompanyDomain = _domain; invoices.Managers.Add(item); _db.SaveChanges(); return RedirectToAction("Index", "Invoice"); } return View(item); }
// // GET: /Invoice/Submit/5 public ActionResult Submit() { Initialize(); var item = new Manager(); if (_managerName == null) return RedirectToAction("NoManager"); item.ManagerPUID = _managerPuid; item.ManagerName = _managerName; return View(item); }