public ActionResult EditNV(int id, nguoi_dung _ngdung) { if (!AuthCheck("admin")) { return(RedirectToAction("Index")); } db.Entry(_ngdung).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("QLNV")); }
public ActionResult EditDoAn(string id, do_an _da) { if (!AuthCheck("admin")) { return(RedirectToAction("Index", "QLDoAn")); } db.Entry(_da).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult EditPhim(string id, phim phim) { if (!AuthCheck("admin")) { return(RedirectToAction("Index", "QLHome")); } db.Entry(phim).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("QLPhim")); }
public ActionResult Delete_LP(FormCollection form) { if (!AuthCheck("admin")) { return(RedirectToAction("Index", "QLHome")); } try { string id = form["idLP_delete"].ToString(); loai_phim lp = db.loai_phim.Where(item => item.id == id).FirstOrDefault(); db.Entry(lp).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); return(Redirect(Url.Action("Index", "QLSetting") + "#LP")); } catch (Exception e) { ViewBag.Error = e.ToString(); return(View("~/Views/QLHome/Error.cshtml")); } }