private void BtnOK_Click(Object Sender, EventArgs e) { if (txtEmail.Text.Trim().Length == 0) { MessageBox.Show(Catalog.GetString("Please enter an Email Address"), Catalog.GetString("Invalid Data entered"), MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } TVerificationResult verification = TStringChecks.ValidateEmail(txtEmail.Text, true); if ((verification != null) && (verification.ResultSeverity == TResultSeverity.Resv_Critical)) { MessageBox.Show(Catalog.GetString("The Email addresses are in invalid format. Use comma or semicolon to separate multiple addresses."), Catalog.GetString("Invalid Data entered"), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!AttachExcelFile && !AttachCSVFile && !AttachPDF) { MessageBox.Show(Catalog.GetString("You need to select at least one file to be attached to the Email."), Catalog.GetString("Invalid Data entered"), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
/// <summary> /// todoComment /// </summary> public static void SendEmailToPartner() { String EmailAddress; TVerificationResult VerificationResult; Boolean EmailAddressValid; EmailAddress = TPartnerFindScreenLogic.ULogic.DetermineCurrentEmailAddress(); VerificationResult = (TVerificationResult)TStringChecks.ValidateEmail(EmailAddress, true); if (VerificationResult == null) { EmailAddressValid = true; } else { EmailAddressValid = false; } if (EmailAddress == "") { MessageBox.Show(Catalog.GetString("No e-mail address for this Partner in the selected address record."), Catalog.GetString("Cannot Send E-mail To Partner"), MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (!EmailAddressValid) { MessageBox.Show( Catalog.GetString("No valid e-mail address for this Partner in the selected address record.") + Environment.NewLine + Environment.NewLine + Catalog.GetString("Details: ") + Environment.NewLine + VerificationResult.ResultText, Catalog.GetString("Cannot Send E-mail To Partner"), MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { throw new NotImplementedException(); // TODO Logic.UCmdMSysMan.SendEmail(EmailAddress); } }
private void BtnOK_Click(Object Sender, EventArgs e) { if (cmbEmail.Text.Trim().Length == 0) { MessageBox.Show(Catalog.GetString("Please enter an Email Address"), Catalog.GetString("Invalid Data entered"), MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } TVerificationResult verification = TStringChecks.ValidateEmail(cmbEmail.Text, true); if ((verification != null) && (verification.ResultSeverity == TResultSeverity.Resv_Critical)) { MessageBox.Show(Catalog.GetString("The Email addresses are in invalid format. Use comma or semicolon to separate multiple addresses."), Catalog.GetString("Invalid Data entered"), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!AttachExcelFile && !AttachCSVFile && !AttachPDF) { MessageBox.Show(Catalog.GetString("You need to select at least one file to be attached to the Email."), Catalog.GetString("Invalid Data entered"), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!cmbEmail.Items.Contains(cmbEmail.Text)) { cmbEmail.Items.Insert(0, cmbEmail.Text); } TUserDefaults.SetDefault(TSmtpSender.RECENTADDRS, String.Join("|", cmbEmail.Items.Cast <String>().Take(10).ToArray())); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
/// <summary> /// todoComment /// </summary> /// <param name="e"></param> /// <param name="AVerificationResult"></param> public static void VerifyEmailAddress(DataColumnChangeEventArgs e, out TVerificationResult AVerificationResult) { AVerificationResult = (TVerificationResult)TStringChecks.ValidateEmail(e.ProposedValue.ToString(), true); }