home *** CD-ROM | disk | FTP | other *** search
/ 41-134-104-147.dsl.mweb.co.za / 41-134-104-147.dsl.mweb.co.za.tar / 41-134-104-147.dsl.mweb.co.za / otherEnq.aspx.vb < prev    next >
Text File  |  2010-08-20  |  3KB  |  55 lines

  1. 
  2. Partial Class otherEnq
  3.     Inherits System.Web.UI.Page
  4.     Dim myFunctions As New Functions
  5.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  6.         If Not myFunctions.testLogin(Me.Context) Then
  7.             Response.Redirect("~/Default.aspx", True)
  8.         Else
  9.             myFunctions.logMe(Request.Cookies("hcUid").Value, "Enquiries Page")
  10.         End If
  11.         Try
  12.             Dim reqType As String = Request.QueryString("r").Trim
  13.             If reqType = "ca" Then
  14.                 '<asp:ListItem>Address Change</asp:ListItem>
  15.                 For Each myItem As ListItem In lstRequest.Items
  16.                     If myItem.Value = "Address Change" Then myItem.Selected = True
  17.                 Next
  18.             End If
  19.         Catch ex As Exception
  20.  
  21.         End Try
  22.     End Sub
  23.  
  24.     Protected Sub imgHome_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgHome.Click
  25.         Response.Redirect("~/enquiries.aspx", True)
  26.     End Sub
  27.  
  28.     Protected Sub imgLogout_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgLogout.Click
  29.         If myFunctions.logout(Me.Context) Then Response.Redirect("~/Default.aspx", True)
  30.     End Sub
  31.  
  32.     Protected Sub imgSubmit_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgSubmit.Click
  33.         Dim toAddress As String = "info@healthcard.co.za"
  34.         Dim subject As String = "Enquiry from Online Portal"
  35.         Dim requestType As String = ""
  36.         Dim email As String = txtEmail.Text
  37.         Dim comments As String = txtComments.Text
  38.         Dim body As String = ""
  39.         For Each myItem As ListItem In lstRequest.Items
  40.             If myItem.Selected Then requestType &= myItem.Value & ";"
  41.         Next
  42.         If requestType <> "" And email <> "" And comments <> "" Then
  43.             body = "<b>A request was received from the HealthCard Online Portal</b><br/><br/>"
  44.             body &= "<b>Request Details</b><br/>"
  45.             body &= "Date:" & Now.ToShortDateString & " " & Now.ToShortTimeString & "<br/>"
  46.             body &= "Email Address:" & email & "<br/>"
  47.             body &= requestType & "<br/>"
  48.             body &= comments
  49.             Dim myMailer As New MAILER(True)
  50.             Dim success As String = myMailer.sendMail("HealthCard Portal", toAddress, subject, body, True)
  51.             If success = "True" Then Response.Redirect("~/frmThankyou.aspx", True)
  52.         End If
  53.     End Sub
  54. End Class
  55.