public ActionResult EditProprietor(proprietor model) { if (ModelState.IsValid) { db.Entry(model).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("ProprietorIndex")); } else { ModelState.AddModelError("", "Please fill in all the fields properly."); return(View(model)); } }
public ActionResult CreateProprietor(proprietor model) { if (ModelState.IsValid) { db.proprietors.Add(model); db.SaveChanges(); return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Plaease fill in all the fields properly."); return(View(model)); } }