コード例 #1
0
        private bool PartyProfiles_Add()
        {
            Settings.PartyProfile p = new Settings.PartyProfile();

            if (!AgentProfiles_Add() ||
                !BrokerProfiles_Add() ||
                !BuyerProfiles_Add() ||
                !EscrowProfiles_Add()
                )
            {
                return(false);
            }

            p._ProfileName      = PartyProfiles.Names.Text;
            p.AgentProfileName  = AgentProfiles.Names.Text;
            p.BrokerProfileName = BrokerProfiles.Names.Text;
            p.BuyerProfileName  = BuyerProfiles.Names.Text;
            p.EscrowProfileName = EscrowProfiles.Names.Text;

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

            if (string.IsNullOrWhiteSpace(p._ProfileName))
            {
                Message.Exclaim(m1 + "Party ProfileName" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.AgentProfileName))
            {
                Message.Exclaim(m1 + "AgentProfileName" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.BrokerProfileName))
            {
                Message.Exclaim(m1 + "BrokerProfileName" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.BuyerProfileName))
            {
                Message.Exclaim(m1 + "BuyerProfileName" + m2);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(p.EscrowProfileName))
            {
                Message.Exclaim(m1 + "EscrowProfileName" + m2);
                return(false);
            }

            Settings.Parties.PartyProfileNames2PartyProfile[PartyProfiles.Names.Text] = p;
            Settings.Parties.PartyProfileName = PartyProfiles.Names.Text;
            return(true);
        }
コード例 #2
0
 private void PartyProfiles_Select()
 {
     if (PartyProfiles.Names.SelectedItem == null)
     {
         AgentProfiles.Names.SelectedItem  = null;
         BrokerProfiles.Names.SelectedItem = null;
         BuyerProfiles.Names.SelectedItem  = null;
         EscrowProfiles.Names.SelectedItem = null;
         return;
     }
     Settings.PartyProfile p = Settings.Parties.PartyProfileNames2PartyProfile[(string)PartyProfiles.Names.SelectedItem];
     AgentProfiles.Names.SelectedItem  = p.AgentProfileName;
     BrokerProfiles.Names.SelectedItem = p.BrokerProfileName;
     BuyerProfiles.Names.SelectedItem  = p.BuyerProfileName;
     EscrowProfiles.Names.SelectedItem = p.EscrowProfileName;
 }