public ActionResult CreateRole(Role record) { try { if (ModelState.IsValid) { RoleBusiness roleBusiness = new RoleBusiness(); record.Title = record.Name; record.Createdate = DateTime.Now; record.Modifieddate = DateTime.Now; roleBusiness.AddNew(record); return(RedirectToAction("Roles")); } return(View(record)); } catch (FaultException ex) { var exep = Function.GetExeption(ex); var codeExp = exep[1]; string url = "Error/ErrorFunction/" + codeExp; return(RedirectToActionPermanent(url)); } }