public ActionResult Delete(int id) { ViewBag.Title = "Delete Data?"; var data = MUserRepo.getById(id); return(PartialView("_Delete", data)); }
public ActionResult Edit(int id) { var data = MUserRepo.getById(id); ViewBag.Title = "Edit User - " + data.firtsName + " " + data.lastName + "(" + data.username + ")"; ViewBag.ListRole = new SelectList(MRoleRepo.get(), "id", "name"); ViewBag.ListEmployee = new SelectList(MEmployeeRepo.getDataNonUser(), "id", "FullName"); return(PartialView("_Edit", data)); }
public ActionResult Details(int id) { var data = MUserRepo.getById(id); ViewBag.Title = "View User - " + data.firtsName + " " + data.lastName + "(" + data.username + ")"; ViewBag.ListRole = new SelectList(MRoleRepo.get(), "id", "name"); ViewBag.ListEmployee = new SelectList(MEmployeeRepo.get(), "id", "fullName"); return(PartialView("_Details", data)); }
public ActionResult Edit(MUserVM model) { var data = MUserRepo.getById(model.id); if (ModelState.IsValid && MUserRepo.update(model)) { var result = new { success = true, message = "Data Updated! Data User has been updated !", vclass = "alert alert-info" }; return(Json(result, JsonRequestBehavior.AllowGet)); } ViewBag.Title = "Edit User - " + data.firtsName + " " + data.lastName + "(" + data.username + ")"; ViewBag.ListRole = new SelectList(MRoleRepo.get(), "id", "name"); ViewBag.ListEmployee = new SelectList(MEmployeeRepo.getDataNonUser(), "id", "FullName"); return(PartialView("_Edit", model)); }