public ActionResult DepartmentAdd(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.Add(model)) { _departmentBusiness.Save(); return(Redirect("/Staff/Department")); } } return(View(model)); } catch (Exception) { return(View(model)); } }