private void btnEditEmailAccount_Click(object sender, EventArgs e) { if (lvEmailAccounts.SelectedItems.Count == 0) { return; } EmailAccount emailAccount = (EmailAccount)lvEmailAccounts.SelectedItems[0].Tag; Debug.Assert(emailAccount != null, "Email account not selected!"); AddEmailAccountForm frm = new AddEmailAccountForm(emailAccount); if (DialogResult.OK != frm.ShowDialog()) { return; } try { ServicesProvider.GetInstance().GetEmailAccountServices().Update(frm.EmailAccount); } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } LoadEmailAccounts(); }
private void btnAddEmailAccount_Click(object sender, EventArgs e) { AddEmailAccountForm frm = new AddEmailAccountForm(); if (DialogResult.OK != frm.ShowDialog()) { return; } try { ServicesProvider.GetInstance().GetEmailAccountServices().Add(frm.EmailAccount); } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } LoadEmailAccounts(); }