Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Net.Mail
------------------------------------------------
Partial Class Signup
Inherits System.Web.UI.Page
Private Function Record_Input() As Boolean
Dim MyConn As New System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.AppSettings("center_1004_webConnectionString"))
Dim MyCmd As New System.Data.SqlClient.SqlCommand("cp_RecordNewUser", MyConn)
MyCmd.CommandType = CommandType.StoredProcedure
Dim objParam1, objParam2, objParam3, objParam4, objParam5, objParam6, _
objParam7, objParam8, objParam9, objParam10, objParam11, objParam12, objParam13 As SqlParameter
objParam1 = MyCmd.Parameters.Add("@Reg_Date", SqlDbType.DateTime)
objParam2 = MyCmd.Parameters.Add("@Reg_IP", SqlDbType.VarChar)
objParam3 = MyCmd.Parameters.Add("@First_Name", SqlDbType.VarChar)
objParam4 = MyCmd.Parameters.Add("@Last_Name", SqlDbType.VarChar)
objParam5 = MyCmd.Parameters.Add("@Address", SqlDbType.VarChar)
objParam6 = MyCmd.Parameters.Add("@City", SqlDbType.VarChar)
objParam7 = MyCmd.Parameters.Add("@State", SqlDbType.Int)
objParam8 = MyCmd.Parameters.Add("@Zip", SqlDbType.VarChar)
objParam9 = MyCmd.Parameters.Add("@Phone", SqlDbType.VarChar)
objParam10 = MyCmd.Parameters.Add("@Gender", SqlDbType.Int)
objParam11 = MyCmd.Parameters.Add("@Age_Group", SqlDbType.Int)
objParam12 = MyCmd.Parameters.Add("@Email", SqlDbType.VarChar)
objParam13 = MyCmd.Parameters.Add("@Password", SqlDbType.VarChar)
objParam1.Direction = ParameterDirection.Input
objParam2.Direction = ParameterDirection.Input
objParam3.Direction = ParameterDirection.Input
objParam4.Direction = ParameterDirection.Input
objParam5.Direction = ParameterDirection.Input
objParam6.Direction = ParameterDirection.Input
objParam7.Direction = ParameterDirection.Input
objParam8.Direction = ParameterDirection.Input
objParam9.Direction = ParameterDirection.Input
objParam10.Direction = ParameterDirection.Input
objParam11.Direction = ParameterDirection.Input
objParam12.Direction = ParameterDirection.Input
objParam13.Direction = ParameterDirection.Input
objParam1.Value = Now() 'Registration Date
objParam2.Value = GetIPAddress() 'Registration IP
objParam3.Value = StrConv(Trim(tbx_FirstName.Text), VbStrConv.ProperCase) 'First Name
objParam4.Value = StrConv(Trim(tbx_LastName.Text), VbStrConv.ProperCase) 'Last Name
objParam5.Value = StrConv(Trim(tbx_Address.Text), VbStrConv.ProperCase) 'Address
objParam6.Value = StrConv(Trim(tbx_City.Text), VbStrConv.ProperCase) 'City
objParam7.Value = dd_State.SelectedValue 'State
objParam8.Value = Trim(tbx_City.Text) 'Zip
objParam9.Value = Trim(tbx_Phone.Text) 'Phone
objParam10.Value = Trim(tbx_Phone.Text) 'Phone
objParam11.Value = dd_AgeGroup.SelectedValue 'Age Group
objParam12.Value = Trim(tbx_Email.Text) 'Email
objParam12.Value = Trim(tbx_Password.Text) 'Password
Try
If MyConn.State = ConnectionState.Closed Then
MyConn.Open()
End If
Dim ar As IAsyncResult = MyCmd.BeginExecuteNonQuery()
While Not ar.IsCompleted
End While
Dim effected As Integer = MyCmd.EndExecuteNonQuery(ar)
MyCmd.Connection.Close()
Catch ex As Exception
lblMessage.Text = "Error Submitting New User Data!"
End Try
If lblMessage.Text = "" Then
Return True
End If
End Function
End Class
|