private void SetDataSources() { var allProducts = ProductOperations.GetAll()?.ItemList ?? new List <ProductDto>(); var branchProducts = ddlBranches.SelectedValue == "0" ? new List <ProductDto>() : ProductOperations.GetAllByStoreId(int.Parse(ddlBranches.SelectedValue)); RadListBoxSource.DataSource = branchProducts.Count > 0 ? allProducts.Where(p => !branchProducts.Contains(p)) : allProducts; RadListBoxSource.DataBind(); RadListBoxDestination.DataSource = branchProducts; RadListBoxDestination.DataBind(); }
private void ShowRMDetails(int rmId) { rmStaffVo = advisorStaffBo.GetAdvisorStaffProfile(rmId); BindTeamTitleDropList(rmStaffVo.HierarchyTeamId); BindTitleApplicableLevelAndChannel(rmStaffVo.HierarchyTitleId); BindReportingManager(rmStaffVo.HierarchyRoleId); ddlDepart.SelectedValue = rmStaffVo.departmentId.ToString(); if (rmStaffVo.departmentId != 0) { BindAdviserrole(rmStaffVo.departmentId); string[] RoleIds = rmStaffVo.roleIds.Split(','); for (int i = 0; i < RoleIds.Length; i++) { foreach (RadListBoxItem li in chkbldepart.Items) { if (RoleIds[i] == li.Value.ToString()) { li.Checked = true; } } } } txtFirstName.Text = rmStaffVo.FirstName; txtMiddleName.Text = rmStaffVo.MiddleName; txtLastName.Text = rmStaffVo.LastName; txtStaffcode.Text = rmStaffVo.StaffCode; ddlBranch.SelectedValue = rmStaffVo.BranchId.ToString(); ddlTeamList.SelectedValue = rmStaffVo.HierarchyTeamId.ToString(); ddlTitleList.SelectedValue = rmStaffVo.HierarchyTitleId.ToString(); AgentCodesvalidation(); ddlRportingRole.SelectedValue = rmStaffVo.HierarchyRoleId.ToString(); ddlReportingMgr.SelectedValue = rmStaffVo.ReportingManagerId.ToString(); txtMobileNumber.Text = rmStaffVo.Mobile.ToString(); txtEmail.Text = rmStaffVo.Email.ToString(); if (!string.IsNullOrEmpty(rmStaffVo.OfficePhoneDirectIsd)) { txtPhDirectISD.Text = rmStaffVo.OfficePhoneDirectIsd.ToString(); } if (rmStaffVo.OfficePhoneDirectNumber != 0) { txtPhDirectPhoneNumber.Text = rmStaffVo.OfficePhoneDirectNumber.ToString(); } if (!string.IsNullOrEmpty(rmStaffVo.OfficePhoneExtIsd)) { txtPhExtISD.Text = rmStaffVo.OfficePhoneExtIsd.ToString(); } if (rmStaffVo.OfficePhoneExtNumber != 0) { txtPhExtPhoneNumber.Text = rmStaffVo.OfficePhoneExtNumber.ToString(); } if (!string.IsNullOrEmpty(rmStaffVo.OfficePhoneExtStd)) { txtExtSTD.Text = rmStaffVo.OfficePhoneExtStd.ToString(); } if (rmStaffVo.ResPhoneIsd != 0) { txtPhResiISD.Text = rmStaffVo.ResPhoneIsd.ToString(); } if (rmStaffVo.ResPhoneNumber != 0) { txtPhResiPhoneNumber.Text = rmStaffVo.ResPhoneNumber.ToString(); } if (rmStaffVo.ResPhoneStd != 0) { txtResiSTD.Text = rmStaffVo.ResPhoneStd.ToString(); } if (!string.IsNullOrEmpty(rmStaffVo.OfficePhoneDirectStd)) { txtPhDirectSTD.Text = rmStaffVo.OfficePhoneDirectStd.ToString(); } if (rmStaffVo.Fax != 0) { txtFaxNumber.Text = rmStaffVo.Fax.ToString(); } if (rmStaffVo.FaxIsd != 0) { txtFaxISD.Text = rmStaffVo.FaxIsd.ToString(); } if (!string.IsNullOrEmpty(rmStaffVo.EUIN)) { txtEUIN.Text = rmStaffVo.EUIN.ToString(); } if (rmStaffVo.FaxStd != 0) { txtExtSTD.Text = rmStaffVo.FaxStd.ToString(); } if (!string.IsNullOrEmpty(rmStaffVo.AAC_AgentCode)) { txtAgentCode.Text = rmStaffVo.AAC_AgentCode.ToString(); //lblAgentCode.Text = rmStaffVo.AAC_AgentCode; //imgBtnReferesh.Visible = false; //imgAddAgentCode.Visible = false; } else { //lblAgentCode.Text = "N/A"; //imgBtnReferesh.Enabled = true; //imgAddAgentCode.Enabled = true; } if (!string.IsNullOrEmpty(rmStaffVo.StaffBranchAssociation)) { DataSet ds = advisorStaffBo.GetStaffBranchAssociation(rmStaffVo.StaffBranchAssociation, advisorVo.advisorId); RadListBoxDestination.DataSource = ds.Tables[0]; RadListBoxDestination.DataValueField = ds.Tables[0].Columns["StaffBranch"].ToString();; RadListBoxDestination.DataTextField = ds.Tables[0].Columns["AB_BranchName"].ToString(); RadListBoxDestination.DataBind(); LBStaffBranch.DataSource = ds.Tables[1]; LBStaffBranch.DataValueField = ds.Tables[1].Columns["AB_BranchId"].ToString();; LBStaffBranch.DataTextField = ds.Tables[1].Columns["AB_BranchName"].ToString(); LBStaffBranch.DataBind(); } }