// GET: /Users/ public ActionResult Index(int isdelete = 0, int restoreid = 0) { var list = (dynamic)null; TempData["restore"] = ""; if (isdelete == 0) { if (restoreid > 0) { if (db.tblStage.Any(a => a.StageID == restoreid && a.IsDelete == true)) { tblStage tblStage = db.tblStage.Find(restoreid); tblStage.IsDelete = false; db.Entry(tblStage).State = EntityState.Modified; db.SaveChanges(); TempData["msg"] = "Record Restore Successfully"; // return View("Index","Stage"); } } list = db.tblStage.Where(a => a.IsDelete != true).OrderByDescending(a => a.StageID).ToList(); } else { TempData["restore"] = "restore"; list = db.tblStage.Where(a => a.IsDelete == true).OrderByDescending(a => a.StageID).ToList(); } return(View(list)); }
public ActionResult DeleteConfirmed(int id) { tblStage tblStage = db.tblStage.Find(id); db.tblStage.Remove(tblStage); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "StageID,StageName,Password,CreatedBy,UpdatedBy,CreateDate,UpdateDate,IsLogin,IsDelete,IsActive,RoleID,SchoolID,DeleteBy,DeleteDate")] tblStage tblStage) { if (ModelState.IsValid) { db.tblStage.Add(tblStage); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblStage)); }
public ActionResult Edit([Bind(Include = "StageID,StageName,Password,CreatedBy,UpdatedBy,CreateDate,UpdateDate,IsLogin,IsDelete,IsActive,RoleID,SchoolID,DeleteBy,DeleteDate")] tblStage tblStage) { if (ModelState.IsValid) { db.Entry(tblStage).State = EntityState.Modified; db.SaveChanges(); TempData["msg"] = "Record Update Successfully"; return(RedirectToAction("Index")); } return(View(tblStage)); }
// GET: /Users/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblStage tblStage = db.tblStage.Find(id); if (tblStage == null) { return(HttpNotFound()); } return(View(tblStage)); }
// GET: /Users/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblStage tblStage = db.tblStage.Find(id); ViewBag.RoleID = new SelectList(db.tblRoles, "RoleID", "RoleName", tblStage.StageID); ViewBag.SchoolID = new SelectList(db.tblSchool, "SchoolID", "SchoolName", tblStage.SchoolID); if (tblStage == null) { return(HttpNotFound()); } return(View(tblStage)); }