public JsonResult Create(DepartmentViewModel model) { ResponseViewModel resp = new ResponseViewModel(); try { resp = DepartmentObject.Register(model); } catch (Exception ex) { resp.Success = false; resp.Message = ex.Message; } return(Json(resp, JsonRequestBehavior.AllowGet)); }