Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack = True Then
For intX As Int32 = 1 To 15
cklWorkWillingStations.Items.Add("Station " & intX)
Next
cklWorkWillingStations.Items.Add("Dispatch")
End If
If Not Page.IsPostBack = True Then
For intX As Int32 = 1 To 15
cklwillingtofirst.Items.Add("Station " & intX)
Next
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim objMailClient As System.Net.Mail.SmtpClient
Dim objMailMessage As System.Net.Mail.MailMessage
Dim strHost As String = "70.60.17.9"
Dim strMessage As String = String.Empty
Dim strTo As String = "uaf@seoems.com"
Dim strFrom As String = "uaf@seoems.com"
Dim strSubject As String = "Universal Alert Form"
Dim intX As Int32 = 0
Dim bolFirstItem As Boolean = True
divMessage.Visible = True
strMessage += "
"
strMessage += "" & lblInitialOrUpdate.Text & " " & rblInitialOrUpdate.selectedvalue & " "
strMessage += "" & lblFirstName.Text & " " & txtFirstName.Text & " "
strMessage += "" & lblLastName.Text & " " & txtLastName.Text & " "
strMessage += "" & lblHomeStation.Text & " " & txtHomeStation.Text & " "
strMessage += "" & lblSeoemsEmail.Text & " " & txtSeoemsEmail.Text & " "
strMessage += "" & lblCertLevel.Text & " " & txtCertLevel.Text & " "
strMessage += "" & lblSeoemsId.Text & " " & txtSeoemsId.Text & " "
strMessage += "" & lblWorkWillingStations.Text & " "
Try
'This Loop adds to the email, all the stations which the employee checks---------
For intX = 0 To cklWorkWillingStations.Items.Count - 1
If cklWorkWillingStations.Items(intX).Selected = True Then
If bolFirstItem = False Then
strMessage += ", "
End If
strMessage += cklWorkWillingStations.Items(intX).Text
bolFirstItem = False
End If
Next
Catch ex As Exception
End Try
strMessage += " "
strMessage += "" & lblwillingtofirst.Text & " "
Try
'This Loop adds to the email, all the stations which the employee checks---------
bolFirstItem = True
For intX = 0 To cklwillingtofirst.Items.Count - 1
If cklwillingtofirst.Items(intX).Selected = True Then
If bolFirstItem = False Then
strMessage += ", "
End If
strMessage += cklwillingtofirst.Items(intX).Text
bolFirstItem = False
End If
Next
Catch ex As Exception
End Try
strMessage += " "
strMessage += "" & lblAllCallsForCounties.Text & " "
'This Loop adds to the email, all the counties which the employee checks---------
bolFirstItem = True
For intX = 0 To cklAllCallsForCounties.Items.Count - 1
If cklAllCallsForCounties.Items(intX).Selected = True Then
If bolFirstItem = False Then
strMessage += ", "
End If
strMessage += cklAllCallsForCounties.Items(intX).Text
bolFirstItem = False
End If
Next
strMessage += " "
strMessage += "" & lblTextMessaging.Text & " "
If Not rblTextMessaging.SelectedItem Is Nothing = True Then
strMessage += rblTextMessaging.SelectedItem.Text
Else
strMessage += "No Counties Were Selected"
End If
strMessage += " "
strMessage += "" & lblPhoneNumber.Text & " " & txtPhoneNumber.Text & " "
strMessage += "" & lblCellCarrierName.Text & " " & txtCellCarrierName.Text & " "
strMessage += "
"
'COMMENT or remove the next 4 lines of code and UNCOMMENT the following 5 lines of code, before you put this in production-------------------------------------------------------
'strMessage = strMessage.Insert(strMessage.LastIndexOf("<"), "")
'lblTest.Text = "
" & strMessage
'lblTest.Text += "
"
objMailMessage = New System.Net.Mail.MailMessage(strFrom, strTo, strSubject, strMessage)
objMailMessage.IsBodyHtml = True
objMailClient = New System.Net.Mail.SmtpClient
objMailClient.Host = "70.60.17.9"
objMailClient.Credentials = New System.Net.NetworkCredential("uaf@seoems", "uaf2")
Try
objMailClient.Send(objMailMessage)
lblFormSubmissionStatus.Text = "Thank You! We have recieved your information"
Catch ex As Exception
lblFormSubmissionStatus.Text = "There was an error sending the information in which you entered!"
End Try
End Sub
Protected Sub btnClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClear.Click
divMessage.Visible = False
txtFirstName.Text = ""
txtLastName.Text = ""
txtHomeStation.Text = ""
txtCertLevel.Text = ""
txtSeoemsId.Text = ""
txtPhoneNumber.Text = ""
txtCellCarrierName.Text = ""
txtSeoemsEmail.Text = ""
rblTextMessaging.Items.FindByText("Yes").Selected = False
rblTextMessaging.Items.FindByText("No").Selected = True
For intX As Int32 = 0 To cklWorkWillingStations.Items.Count - 1
cklWorkWillingStations.Items(intX).Selected = False
Next
For intX As Int32 = 0 To cklAllCallsForCounties.Items.Count - 1
cklAllCallsForCounties.Items(intX).Selected = False
Next
lblTest.Text = ""
End Sub
Protected Sub cklWorkWillingStations_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cklWorkWillingStations.SelectedIndexChanged
End Sub
Protected Sub CheckBoxLis
End Sub
Protected Sub cklwillingtofirst_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cklwillingtofirst.SelectedIndexChanged
End Sub
End Class