コード例 #1
0
        private void LoadOrganizationCode()
        {
            OrganizationCodeCollection orgCodeColl = new OrganizationCodeCollection();

            orgCodeColl = CurrentUser.GetAssignedOrganizationCodes();
            //remove Org Code 0 from the list
            OrganizationCode spdOrgCode = new OrganizationCode();

            spdOrgCode.OrganizationCodeID = 1;
            orgCodeColl.Remove(spdOrgCode);

            rcbOrganizationCode.Items.Clear();

            int RegionID = -1;

            RegionID = Convert.ToInt32(rcbRegion.SelectedValue);
            enumOrgFormat format = enumOrgFormat.New;

            if (rdOrgCode.SelectedIndex > -1)
            {
                string strformat = rdOrgCode.SelectedValue;
                Enum.TryParse <enumOrgFormat>(strformat, true, out format);
            }

            if (RegionID > 0)
            {
                OrganizationCodeCollection filteredbyregion = orgCodeColl.GetByRegion(RegionID);
                if (format == enumOrgFormat.New)
                {
                    ControlUtility.BindRadComboBoxControl(rcbOrganizationCode, filteredbyregion, null, "NewOrgCodeLine", "OrganizationCodeID", "<<--Select Organization -->>");
                }
                else
                {
                    ControlUtility.BindRadComboBoxControl(rcbOrganizationCode, filteredbyregion, null, "OldOrgCodeLine", "OrganizationCodeID", "<<--Select Organization -->>");
                }
            }
            else
            {
                if (format == enumOrgFormat.New)
                {
                    ControlUtility.BindRadComboBoxControl(rcbOrganizationCode, orgCodeColl, null, "NewOrgCodeLine", "OrganizationCodeID", "<<--Select Organization -->>");
                }
                else
                {
                    ControlUtility.BindRadComboBoxControl(rcbOrganizationCode, orgCodeColl, null, "OldOrgCodeLine", "OrganizationCodeID", "<<--Select Organization -->>");
                }
            }
        }
コード例 #2
0
        private void LoadOrganizationCode()
        {
            rcbOrganizationCode.Items.Clear();
            OrganizationCodeCollection orgCodeColl = CurrentUser.GetAssignedActiveOrganizationCodes();
            enumOrgFormat format = enumOrgFormat.New;

            if (rdOrgCode.SelectedIndex > -1)
            {
                string strformat = rdOrgCode.SelectedValue;
                Enum.TryParse <enumOrgFormat>(strformat, true, out format);
            }
            if (format == enumOrgFormat.New)
            {
                ControlUtility.BindRadComboBoxControl(rcbOrganizationCode, orgCodeColl, null, "NewOrgCodeLine", "OrganizationCodeID", "<<--Select Organization -->>");
            }
            else
            {
                ControlUtility.BindRadComboBoxControl(rcbOrganizationCode, orgCodeColl, null, "OldOrgCodeLine", "OrganizationCodeID", "<<--Select Organization -->>");
            }
        }