public ActionResult DeleteConfirmed(int id) { ETHINICITY_TABLE ethinicity_table = db.ETHINICITY_TABLE.Find(id); db.ETHINICITY_TABLE.Remove(ethinicity_table); db.SaveChanges(); TempData["notice"] = "Ethinicity Has Been Successfully Added"; return(RedirectToAction("Index")); }
// // GET: /Ethnicity/Edit/5 public ActionResult Edit(int id = 0) { ETHINICITY_TABLE ethinicity_table = db.ETHINICITY_TABLE.Find(id); if (ethinicity_table == null) { return(HttpNotFound()); } 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)); }
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)); }