makumbi says:
Public
Sub
OnSubmit(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Handles
Button1.Click
Dim
confirmValue
As
String
= Request.Form(
"confirm_value"
)
If
confirmValue =
"Yes"
Then
Dim
sqlConnection12
As
New
SqlConnection(conString)
Using Cont
As
New
SqlConnection(conString)
Cont.Open()
Using cmd
As
New
SqlCommand
cmd.Connection = Cont
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText =
"Pushtobilling"
cmd.Parameters.Add(
"@s"
, SqlDbType.NVarChar).Value = PatientNo.Text
cmd.Parameters.Add(
"@cr"
, SqlDbType.NVarChar).Value = PatientName.Text
cmd.Parameters.Add(
"@cp"
, SqlDbType.NVarChar).Value = Particulars.Text
cmd.Parameters.Add(
"@sp"
, SqlDbType.NVarChar).Value = DateTime.Now
cmd.Parameters.Add(
"@sf"
, SqlDbType.NVarChar).Value = RefN.Text
cmd.Parameters.Add(
"@iv"
, SqlDbType.Int).Value = Amount.Text
cmd.Parameters.Add(
"@u"
, SqlDbType.NVarChar).Value = Username.Text
cmd.ExecuteReader()
Cont.Close()
End
Using
End
Using
Exit
Sub
Else
Exit
Sub
End
If
End
Sub
Protected
Sub
OnConfirm(sender
As
Object
, e
As
EventArgs)
Handles
Button1.Click, Button1.Click
Dim
message1
As
String
=
"Are you Sure You Want To Post this Billing"
ClientScript.RegisterStartupScript(
Me
.
GetType
(),
"alert"
,
"Confirm('"
& message1 &
"');"
,
True
)
End
Sub
Replace above with below.
Public Sub OnSubmit(ByVal sender As Object, ByVal e As EventArgs) Handles Button5.Click
Dim confirmValue As String = Request.Form("confirm_value")
If confirmValue = "Yes" Then
Dim sqlConnection12 As New SqlConnection(conString)
Using Cont As New SqlConnection(conString)
Cont.Open()
Using cmd As New SqlCommand
cmd.Connection = Cont
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "Pushtobilling"
cmd.Parameters.Add("@s", SqlDbType.NVarChar).Value = PatientNo.Text
cmd.Parameters.Add("@cr", SqlDbType.NVarChar).Value = PatientName.Text
cmd.Parameters.Add("@cp", SqlDbType.NVarChar).Value = Particulars.Text
cmd.Parameters.Add("@sp", SqlDbType.NVarChar).Value = DateTime.Now
cmd.Parameters.Add("@sf", SqlDbType.NVarChar).Value = RefN.Text
cmd.Parameters.Add("@iv", SqlDbType.Int).Value = Amount.Text
cmd.Parameters.Add("@u", SqlDbType.NVarChar).Value = Username.Text
cmd.ExecuteReader()
Cont.Close()
End Using
End Using
Exit Sub
Else
'ClientScript.RegisterStartupScript(Me.GetType(), "alert", "alert('Action Cancelled!')", True)
Exit Sub
End If
End Sub
Protected Sub OnConfirm(sender As Object, e As EventArgs) Handles Button1.Click
Dim message1 As String = "Are you Sure You Want To Post this Billing"
ClientScript.RegisterStartupScript(Me.GetType(), "alert", "Confirm('" & message1 & "');", True)
End Sub
makumbi says:
document.getElementById(
and
document.getElementById('Button5').click();