public ActionResult BranchCreate(OfficeDTOs data) { //if (!ViewBag.AllowCreate) //{ // ViewBag.Error = "You are not Authorize to use this Page"; // return PartialView("_partialviewNotFound"); //} OfficeDTOs officeData = new OfficeDTOs(); try { ViewBag.officeList = _officeService.GetOfficeData(); ViewBag.officeTypeList = _officeTypeService.GetOfficeTypes(); officeData.EmployeeList = _officeService.GetEmployeeList(); officeData.RemoteList = _officeService.GetRemoteList(); OfficeDTOs resOfficeDTO = new OfficeDTOs(); resOfficeDTO = _officeService.InsertOffice(data); ViewBag.success = String.Format("New Branch Added"); ModelState.Clear(); return(View(officeData)); } catch (Exception Ex) { ViewBag.error = Ex.Message; return(View(officeData)); } }