private Person SelectOwner() { using (SearchClientForm searchClientForm = SearchClientForm.GetInstance(OClientTypes.Person, true)) { searchClientForm.ShowDialog(); try { if (ServicesProvider.GetInstance().GetClientServices().ClientIsAPerson(searchClientForm.Client) && !searchClientForm.Client.Active) { return((Person)searchClientForm.Client); } else { return(null); } //else // textBoxName.Text = String.Empty; } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); return(null); } } }
private void BtnSelectContactClick(object sender, EventArgs e) { using (SearchClientForm searchClientForm = SearchClientForm.GetInstance(OClientTypes.Person, true)) { searchClientForm.ShowDialog(); var contact = new Contact(); try { if (searchClientForm.Client != null) { contact.Tiers = searchClientForm.Client; } if (!ServicesProvider.GetInstance().GetClientServices().ClientCanBeAddToCorporate( searchClientForm.Client, Corporate)) { return; } if (contact.Tiers != null) { Corporate.Contacts.Add(contact); } DisplayListContactCorporate(Corporate.Contacts); } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } } }