public ActionResult Create() { LocationOfProductModel model = new LocationOfProductModel(); model.Actived = true; return(View(model)); }
public ActionResult Edit(LocationOfProductModel model) { if (ModelState.IsValid) { db.Entry(model).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Edit(int id = 0) { LocationOfProductModel model = db.LocationOfProductModel.Find(id); if (model == null) { return(HttpNotFound()); } return(View(model)); }
public ActionResult Create(LocationOfProductModel model) { if (ModelState.IsValid) { db.LocationOfProductModel.Add(model); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(model)); }