private void BrokerProfiles_Select()
 {
     if (BrokerProfiles.Names.SelectedItem == null)
     {
         BrokerAddress.Text   = "";
         BrokerCity.Text      = "";
         BrokerCompany.Text   = "";
         BrokerLicenseNo.Text = "";
         BrokerName.Text      = "";
         BrokerPhone.Text     = "";
         BrokerState.Text     = "";
         BrokerZip.Text       = "";
         return;
     }
     Settings.BrokerProfile p = Settings.Parties.BrokerProfileNames2BrokerProfile[(string)BrokerProfiles.Names.SelectedItem];
     BrokerAddress.Text   = p.Address;
     BrokerCity.Text      = p.City;
     BrokerCompany.Text   = p.Company;
     BrokerLicenseNo.Text = p.LicenseNo;
     BrokerName.Text      = p.Name;
     BrokerPhone.Text     = p.Phone;
     BrokerState.Text     = p.State;
     BrokerZip.Text       = p.Zip;
 }
        private bool BrokerProfiles_Add()
        {
            Settings.BrokerProfile p = new Settings.BrokerProfile();

            p._ProfileName = BrokerProfiles.Names.Text;
            p.Name         = BrokerName.Text;
            p.Address      = BrokerAddress.Text;
            p.City         = BrokerCity.Text;
            p.Company      = BrokerCompany.Text;
            p.LicenseNo    = BrokerLicenseNo.Text;
            p.Phone        = BrokerPhone.Text;
            p.State        = BrokerState.Text;
            p.Zip          = BrokerZip.Text;

            string m1 = "";
            string m2 = " is not set.";

            if (string.IsNullOrWhiteSpace(p._ProfileName))
            {
                Message.Exclaim(m1 + "Broker ProfileName" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.Name))
            {
                Message.Exclaim(m1 + "BrokerName" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.Address))
            {
                Message.Exclaim(m1 + "BrokerAddress" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.City))
            {
                Message.Exclaim(m1 + "BrokerCity" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.Company))
            {
                Message.Exclaim(m1 + "BrokerCompany" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.LicenseNo))
            {
                Message.Exclaim(m1 + "BrokerLicenseNo" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.Phone))
            {
                Message.Exclaim(m1 + "BrokerPhone" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.State))
            {
                Message.Exclaim(m1 + "BrokerState" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.Zip))
            {
                Message.Exclaim(m1 + "BrokerZip" + m2);
                return(false);
            }

            Settings.Parties.BrokerProfileNames2BrokerProfile[BrokerProfiles.Names.Text] = p;
            return(true);
        }