Partial Class reserve
Inherits baseclass
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Calendar1.SelectedDate = "06/12/2006"
TextBox1.Text = Request.Form("text1")
If Page.IsPostBack Then
Else
'prefill
If Request.QueryString("option") Is Nothing
End If
If InStr(Now.ToShortTimeString, "am", CompareMethod.Text) Then
DropDownList2.SelectedValue = "am"
TextBox2.Text = Replace(Now.ToShortTimeString, " am", "", , , CompareMethod.Text)
Else
DropDownList2.SelectedValue = "pm"
TextBox2.Text = Replace(Now.ToShortTimeString, " pm", "", , , CompareMethod.Text)
End If
Dim scriptstr As String = ""
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "c1", scriptstr)
scriptstr = ""
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "c2", scriptstr)
scriptstr = ""
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "c3", scriptstr)
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
sendEmail("Casanova - Reserve a Table", TextBox1.Text & " " & TextBox2.Text & " " & DropDownList2.SelectedValue, DropDownList1.SelectedValue, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text, TextBox7.Text, TextBox21.Text, "casanovamaui@yahoo.com")
Response.Redirect("thankyou.aspx")
End Sub
Sub sendEmail(ByVal resfor As String, ByVal fdate As String, ByVal persons As String, ByVal cfirst As String, ByVal clast As String, ByVal cemail As String, ByVal cphone As String, ByVal notes As String, ByVal resort As String, ByVal email As String)
Dim EmailBody As String = ""
EmailBody = EmailBody & "Reservation for : " & resfor & "
"
EmailBody = EmailBody & "For : " & persons & " person(s)
"
EmailBody = EmailBody & "Date/Time : " & fdate & "
"
EmailBody = EmailBody & "Contact Name : " & cfirst & " " & clast & "
"
EmailBody = EmailBody & "Email : " & cemail & "
"
EmailBody = EmailBody & "Phone : " & cphone & "
"
EmailBody = EmailBody & "Resort or Local Contact Phone Number : " & resort & "
"
EmailBody = EmailBody & "Additional information : " & notes & "
"
'mailing section
Dim strHost
strHost = "mail.honstudios.com"
'Dim objMail As New ASPEMAILLib.MailSender()
Dim objMail = Server.CreateObject("Persits.MailSender")
''''' greatlifetours notification section
objMail.Host = strHost
objMail.IsHTML = True
objMail.From = cemail
objMail.FromName = cfirst & " " & clast
objMail.username = "mailer@honstudios.com"
objMail.password = "alamakota"
' message subject
objMail.Subject = "Reservation request for: " & resfor
' message body
' append body from file
objMail.Body = "There is new reservation request from your site
You can view the info below :
" _
& EmailBody
objMail.AddAddress(email)
objMail.AddAddress("sans@honstudios.com")
objMail.AddAddress("suan2chris@hotmail.com")
objMail.Send() ' send message
objMail.ResetAll()
End Sub
End Class