private bool AgentProfiles_Add() { Settings.AgentProfile p = new Settings.AgentProfile(); p._ProfileName = AgentProfiles.Names.Text; p.Name = AgentName.Text; p.LicenseNo = AgentLicenseNo.Text; p.Email = AgentEmail.Text; p.InitialFile = AgentInitial.ImageLocation; p.SignatureFile = AgentSignature.ImageLocation; string m1 = ""; string m2 = " is not set."; if (string.IsNullOrWhiteSpace(p._ProfileName)) { Message.Exclaim(m1 + "Agent ProfileName" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.Name)) { Message.Exclaim(m1 + "AgentName" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.InitialFile)) { Message.Exclaim(m1 + "AgentInitial" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.SignatureFile)) { Message.Exclaim(m1 + "AgentSignature" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.LicenseNo)) { Message.Exclaim(m1 + "AgentLicenseNo" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.Email)) { Message.Exclaim(m1 + "AgentEmail" + m2); return(false); } Settings.Parties.AgentProfileNames2AgentProfile[AgentProfiles.Names.Text] = p; return(true); }
private void AgentProfiles_Select() { if (AgentProfiles.Names.SelectedItem == null) { AgentEmail.Text = ""; AgentInitial.ImageLocation = ""; AgentLicenseNo.Text = ""; AgentName.Text = ""; AgentSignature.ImageLocation = ""; return; } Settings.AgentProfile p = Settings.Parties.AgentProfileNames2AgentProfile[(string)AgentProfiles.Names.SelectedItem]; AgentEmail.Text = p.Email; AgentInitial.ImageLocation = p.InitialFile; AgentLicenseNo.Text = p.LicenseNo; AgentName.Text = p.Name; AgentSignature.ImageLocation = p.SignatureFile; }