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"));
 }
示例#3
0
 public int UpdateDepartment(sp_DepartmentSelect_Result model)
 {
     return(_db.sp_DepartmentUpdate(model.DepartmentId, model.DepartmentName, SessionManager.userId()));
 }