public ActionResult Create(ETHINICITY_TABLE ethinicity_table) { //reset the id if (ModelState.ContainsKey("ETHINICITY_ID")) ModelState["ETHINICITY_ID"].Errors.Clear(); if (ModelState.IsValid) { db.ETHINICITY_TABLE.Add(ethinicity_table); db.SaveChanges(); TempData["notice"] = "The New Ethinicity Has Been Successfully Added"; return RedirectToAction("Index"); } return View(ethinicity_table); }
public ActionResult Edit(ETHINICITY_TABLE ethinicity_table) { if (ModelState.IsValid) { db.Entry(ethinicity_table).State = EntityState.Modified; db.SaveChanges(); TempData["notice"] = "Ethinicity Has Been Successfully Changed"; return RedirectToAction("Index"); } return View(ethinicity_table); }