public ActionResult DepartmentEdit(DepartmentActionView model) { try { HttpCookie reqCookies = Request.Cookies["StaffLoginCookie"]; ResponseStaffLogin login = JsonConvert.DeserializeObject <ResponseStaffLogin>(reqCookies.Value.ToString().UrlDecode()); if (ModelState.IsValid) { model.ActionBy = login.Account; if (_departmentBusiness.Edit(model)) { _departmentBusiness.Save(); return(Redirect("/Staff/Department")); } } return(View(model)); } catch (Exception) { return(View(model)); } }