public ActionResult Create(Status status) { if (ModelState.IsValid) { db.Statuses.Add(status); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.StockTypeId = new SelectList(db.StockTypes, "Id", "Type", status.StockTypeId); return View(status); }
public ActionResult Edit(Status status) { if (ModelState.IsValid) { db.Entry(status).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.StockTypeId = new SelectList(db.StockTypes, "Id", "Type", status.StockTypeId); return View(status); }