private void BuyerProfiles_Select() { if (BuyerProfiles.Names.SelectedItem == null) { CoBuyerInitial.ImageLocation = null; CoBuyerName.Text = null; CoBuyerSignature.ImageLocation = null; BuyerInitial.ImageLocation = null; BuyerName.Text = null; BuyerSignature.ImageLocation = null; UseCoBuyer.Checked = false; UseCoBuyer_CheckedChanged(null, null); RelationshipType.Text = null; LicenseeRelationship.Text = null; UseLicensee.Checked = false; UseLicensee_CheckedChanged(null, null); return; } Settings.BuyerProfile p = Settings.Parties.BuyerProfileNames2BuyerProfile[(string)BuyerProfiles.Names.SelectedItem]; CoBuyerInitial.ImageLocation = p.CoBuyerInitialFile; CoBuyerName.Text = p.CoBuyerName; CoBuyerSignature.ImageLocation = p.CoBuyerSignatureFile; BuyerInitial.ImageLocation = p.InitialFile; BuyerName.Text = p.Name; BuyerSignature.ImageLocation = p.SignatureFile; UseCoBuyer.Checked = p.UseCoBuyer; UseCoBuyer_CheckedChanged(null, null); RelationshipType.Text = p.RelationshipType; LicenseeRelationship.Text = p.LicenseeRelationship; UseLicensee.Checked = p.UseLicensee; UseLicensee_CheckedChanged(null, null); }
private bool BuyerProfiles_Add() { Settings.BuyerProfile p = new Settings.BuyerProfile(); p._ProfileName = BuyerProfiles.Names.Text; p.Name = BuyerName.Text; p.InitialFile = BuyerInitial.ImageLocation; p.SignatureFile = BuyerSignature.ImageLocation; p.UseCoBuyer = UseCoBuyer.Checked; p.CoBuyerName = CoBuyerName.Text; p.CoBuyerInitialFile = CoBuyerInitial.ImageLocation; p.CoBuyerSignatureFile = CoBuyerSignature.ImageLocation; p.UseLicensee = UseLicensee.Checked; p.RelationshipType = RelationshipType.Text; p.LicenseeRelationship = LicenseeRelationship.Text; string m1 = ""; string m2 = " is not set."; if (string.IsNullOrWhiteSpace(p._ProfileName)) { Message.Exclaim(m1 + "Buyer ProfileName" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.Name)) { Message.Exclaim(m1 + "BuyerName" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.InitialFile)) { Message.Exclaim(m1 + "BuyerInitial" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.SignatureFile)) { Message.Exclaim(m1 + "BuyerSignature" + m2); return(false); } if (p.UseCoBuyer) { if (string.IsNullOrWhiteSpace(p.CoBuyerName)) { Message.Exclaim(m1 + "CoBuyerName" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.CoBuyerInitialFile)) { Message.Exclaim(m1 + "CoBuyerInitial" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.CoBuyerSignatureFile)) { Message.Exclaim(m1 + "CoBuyerSignature" + m2); return(false); } } if (p.UseLicensee) { if (string.IsNullOrWhiteSpace(p.RelationshipType)) { Message.Exclaim(m1 + "RelationshipType" + m2); return(false); } if (string.IsNullOrWhiteSpace(p.LicenseeRelationship)) { Message.Exclaim(m1 + "LicenseeRelationship" + m2); return(false); } } Settings.Parties.BuyerProfileNames2BuyerProfile[BuyerProfiles.Names.Text] = p; return(true); }