public ActionResult Create(Commodity_Group commodity_group) { if (ModelState.IsValid) { db.Commodity_Group.Add(commodity_group); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.BusinessID = new SelectList(db.Businesses, "BusinessID", "BusinessName", commodity_group.BusinessID); return View(commodity_group); }
public ActionResult Edit(Commodity_Group commodity_group) { if (ModelState.IsValid) { db.Entry(commodity_group).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.BusinessID = new SelectList(db.Businesses, "BusinessID", "BusinessName", commodity_group.BusinessID); return View(commodity_group); }