public ActionResult BranchIndex(string id) { //if (!ViewBag.AllowView) //{ // ViewBag.Error = "You are not Authorize to use this Page"; // return PartialView("_partialviewNotFound"); //} IEnumerable <OfficeDTOs> officeList = _officeService.getBranchOfficeData(id); List <OfficeDTOs> officeLists = new List <OfficeDTOs>(); foreach (var item in officeList) { item.parentOfficeName = _officeService.GetOfficeName(Convert.ToInt32(item.OfficeParentId)); //item.branchList = _officeService.getBranchOfficeData(item.OfficeId.ToString()); officeLists.Add(item); } return(View(officeLists)); }