private void BindBranches(LoginUser curLoginUser, string regionId, string divisionId) { int iRegionID = int.Parse(regionId); int iDivisionID = int.Parse(divisionId); iRegionID = iRegionID >= 0 ? iRegionID : 0; iDivisionID = iDivisionID >= 0 ? iDivisionID : 0; LPWeb.BLL.Branches BrancheManager = new LPWeb.BLL.Branches(); DataTable BranchListData = null; if (curLoginUser.userRole.OtherLoanAccess == true) // All Loans { BranchListData = BrancheManager.GetBranchList_AllLoans(curLoginUser.iUserID, iRegionID, iDivisionID); } else // Assigned Loans { BranchListData = BrancheManager.GetBranchList_AssingedLoans(curLoginUser.iUserID, iRegionID, iDivisionID); } DataRow NewBranchRow = BranchListData.NewRow(); NewBranchRow["BranchID"] = "-1"; NewBranchRow["Name"] = "All Branches"; BranchListData.Rows.InsertAt(NewBranchRow, 0); this.ddlBranch.DataSource = BranchListData; this.ddlBranch.DataBind(); }
private void BindBranches(LoginUser curLoginUser, string regionId, string divisionId) { int iRegionID = int.Parse(regionId); int iDivisionID = int.Parse(divisionId); iRegionID = iRegionID >= 0 ? iRegionID : 0; iDivisionID = iDivisionID >= 0 ? iDivisionID : 0; LPWeb.BLL.Branches BrancheManager = new LPWeb.BLL.Branches(); DataTable BranchListData = null; if (CurrUser.bIsCompanyExecutive || CurrUser.bIsRegionExecutive || CurrUser.bIsDivisionUser) { BranchListData = BrancheManager.GetBranchFilter_Executive(CurrUser.iUserID, iRegionID, iDivisionID); } else if (CurrUser.bIsBranchManager) { BranchListData = BrancheManager.GetBranchFilter_Branch_Manager(CurrUser.iUserID, iRegionID, iDivisionID); } else { BranchListData = BrancheManager.GetBranchFilter(CurrUser.iUserID, iRegionID, iDivisionID); } #region Obsolete Code //if (curLoginUser.userRole.OtherLoanAccess == true) // All Loans //{ // BranchListData = BrancheManager.GetBranchList_AllLoans(curLoginUser.iUserID, iRegionID, iDivisionID); //} //else // Assigned Loans //{ // BranchListData = BrancheManager.GetBranchList_AssingedLoans(curLoginUser.iUserID, iRegionID, iDivisionID); //} #endregion DataRow NewBranchRow = BranchListData.NewRow(); NewBranchRow["BranchID"] = "-1"; NewBranchRow["Name"] = "All Branches"; BranchListData.Rows.InsertAt(NewBranchRow, 0); this.ddlBranch.DataSource = BranchListData; this.ddlBranch.DataBind(); }