public ActionResult Update(DepartmentViewModel model) { ResponseViewModel resp = new ResponseViewModel(); try { resp = DepartmentObject.Update(model); } catch (Exception ex) { resp.Success = false; resp.Message = ex.Message; } return(Json(resp, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(DepartmentModel model) { if (DepartmentBO.GetById(model.Id) != null) { if (Validate(model)) { DepartmentBO.Update(model.Id, model.Name, model.UserId, DateTime.Now, DateTime.Now, CurrentUser.Id, CurrentUser.Id); return(RedirectToAction("Index")); } } else { return(RedirectToAction("NotFound", "Home")); } ViewBag.ListUsers = UserBO.GetAll(); return(View(model)); }