I'm trying to create this validation when someone clicks on the BindingNavigatorDeleteItem
to give him a pope message of whether they are sure if they wanted to delete the record. If they click yes, then the delete process continues, if they press no I want to delete process to stop. but also in the event that the record gets deleted I want the applicaiton to email me with the information that was deleted.
How do I do that... my code is below... would anyone be able to assist.
Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click
If MessageBox.Show("Are you sure you want to delete Note for Project" + vbCrLf + "Project Name: " & Me.ProjectNameTextBox.Text & vbCrLf & "Note added by: " & Me.NoteAddedByTextBox.Text, "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.No Then
'If no then stop the process
'If yes then delete the record, but send me and email message of the Project that was deleted
Dim lSlash As Integer = rName.LastIndexOf("\")
Dim fName As String = rName.Substring(lSlash + 1)
Dim emailfrm As String = fName & "@somedomainName.com"
Dim myMailMessage As New MailMessage(emailfrm, "My email address")
myMailMessage.Priority = MailPriority.High
myMailMessage.Subject = "Deleted Note"
Dim bodyText As String = Me.ProjectName_TextBox.text
Dim smtpServer As New smtpClient("Server Name")