| |
||
и элемент управления RequiredFieldValidator, необходимый для проверки того, введено ли в поле какое-либо значение:
id="rfvFirstName" ControlToValidate="txtFirstName" ЕггогМеззаде="Имя" Display="Static" runat=server> * </asp:RequiredFieldValidator>
id="butAdd" text=" OK " Type="Submit" OnClick="SubmitCheckOut_Click" runat="server" />
If Len(Session("CustomerlD")) =.0 Then Response.Redirect("./shopping_cart.aspx") End If End Sub
Dim DBConn as OleDbConnection Dim DBUpdate As New OleDbCommand DBConn = New OleDbConnection("Provider=sqloledb;" _ & "server=localhost;" & "Initial Catalog=INETC15;" _ & "User Id-sa;" _ & "Password-yourpassword;") DBUpdate.CommandText = "Update Customers set " _ & "Status = 'Order Placed', " & "FirstName = '" _ & Replace(txtFirstName.Text, "'", "'"') & "', " _ & "LastName = '" _ & Replace(txtLastName.Text, "'", "'") & "', " & "EmailAddress = '" _ & Replace (txtEmailAddress.Text, "'","''") & "',"_ & "Address - '" _ & Replace (txtAddress. Text, "'", "''") & "', " & "City = '" _ & Replace(txtCity.Text, "'", "''") & "', " _ & "State = '" _ & Replace(txtState.Text, "'","''") & "', " _ & "ZipCode = '" _ & Replace(txtZipCode.Text, "'", "''") & "', " _ & "CCType = '" _ & Replace(txtCCType.Text, "'", "''") & "', " _ & "CCNumber - '" _ & Replace (txtCCNumber. Text, "'", "''") & "', " _ & "CCExpiration. = '" & Replace(txtCCBxpiration.Text, "'", "''") & "' " & "Where CustomerlD = " & Session("CustomerlD") DBUpdate.Connection - DBConn DBUpdate.Connection.Open DBUpdate.ExecuteNonQuery() Session.Abandon pnlForm.Visible = False IblMessage.Text = "Ваш заказ принят." End Sub
& "Status = 'Order Placed', " _ & "FirstName = '" _ & Replace (txtFirstName. Text, "'", "''") & "', " & "LastName = '" _ & Replace(txtLastName.Text, "'", "''") & "', " & "EmailAddress = '" _ & Replace(txtEmailAddress.Text, "'", "'"') & "', " _ & "Address = '" & Replace(txtAddress.Text, "'", "''") & "', " _ & "City = '" _ & Replace (txtCity.Text, "'", "''") & "', " _ & "State = '" _ S, Replace (txtState. Text, "'", "''") & "', " & "ZipCode = '" _ & Replace(txtZipCode.Text, "'", "''") & "', " _ & "CCType = '" & Replace (txtCCType.Text, "'", "''") & '", " _ & "CCNurnber = '" _ & Replace(txtCCNumber.Text, "'", "''") & "', " _ & "CCExpiration = '" _ & Replace(txtCCExpiration.Text, "'", "''") & '" " _ & "Where CustomerlD = " & Session ("CustomerlD.") DBUpdate.Connection = DBConn DBUpdate.Connection.Open DBUpdate.ExecuteNonQuery()
|