public ActionResult DeleteConfirmed(int id) { CERLMenu cerlmenu = db.CERLMenu.Find(id); db.CERLMenu.Remove(cerlmenu); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /CERLMenu/Delete/5 public ActionResult Delete(int id = 0) { CERLMenu cerlmenu = db.CERLMenu.Find(id); if (cerlmenu == null) { return(HttpNotFound()); } return(View(cerlmenu)); }
public ActionResult Edit(CERLMenu cerlmenu) { string UserId = Method.GetLogonUserId(Session, this, User.Identity.Name.ToUpper()); if (ModelState.IsValid) { cerlmenu.editor = UserId; cerlmenu.udt = System.DateTime.Now; db.Entry(cerlmenu).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cerlmenu)); }
public ActionResult Create(CERLMenu cerlmenu) { string UserId = Method.GetLogonUserId(Session, this, User.Identity.Name.ToUpper()); cerlmenu.cdt = DateTime.Now; cerlmenu.udt = DateTime.Now; cerlmenu.editor = UserId; ModelState.Remove("cdt"); ModelState.Remove("udt"); ModelState.Remove("editor"); if (TryUpdateModel(cerlmenu, null, null, new string[] { "udt", "cdt", "editor" })) { db.CERLMenu.Add(cerlmenu); db.SaveChanges(); return(RedirectToAction("Index")); } InitDDLShow(null, ""); return(View(cerlmenu)); }