public ActionResult Edit(string id) { sp_DepartmentSelect_Result model = new sp_DepartmentSelect_Result(); var deptData = DepartmentBusinessLogic.getInstance().getDepartmentById(id); model.DepartmentId = deptData.DepartmentId; model.DepartmentName = deptData.DepartmentName; return(View(model)); }
public ActionResult Edit(sp_DepartmentSelect_Result model) { if (DepartmentBusinessLogic.getInstance().UpdateDepartment(model) == -1) { TempData["Success"] = "Department was successfully updated"; } else { TempData["Error"] = "Department was unsuccessfully updated"; } return(RedirectToAction("Index")); }
public int UpdateDepartment(sp_DepartmentSelect_Result model) { return(_db.sp_DepartmentUpdate(model.DepartmentId, model.DepartmentName, SessionManager.userId())); }