public static JsonResults GetUserBranch(string UserID) { JsonResults BranchList = new JsonResults(); LoginUser currentUser; try { if (!GetUserSession(out currentUser)) { BranchList.ErrorCode = 1001; BranchList.ErrorMessage = ""; return(BranchList); } AdminManagerSP adminObj = new AdminManagerSP(); if (adminObj.GetUserBranch(currentUser.CompanyID, currentUser.UserId, string.IsNullOrEmpty(UserID) ? 0 : Convert.ToInt32(UserID), true, out BranchList)) { BranchList.ErrorCode = 0; BranchList.ErrorMessage = ""; } else { BranchList.ErrorCode = 1; BranchList.ErrorMessage = "Failed to get branch List. please try again later"; } } catch (Exception ex) { Utils.Write(ex); } return(BranchList); }