Partial Class tuifanjiezhan
Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
Response.Write("<script language=javascript>alert('请填写入住房间!!')</script>")
TextBox1.Focus()
Exit Sub
End If Session("name") = TextBox8.Text
Session("room") = TextBox1.Text Session("checkin") = TextBox3.Text
Session("out") = TextBox4.Text Session("total") = Label3.Text
Response.Redirect("print.aspx")
End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
search.init()
TextBox4.Text = Now
Label4.Text = Today
Label5.Text = userinfo.Userid
End Sub Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
Dim ds As New Data.DataSet
If TextBox1.Text = "" Then
Response.Write("<script language=javascript>alert('请输入房间号!')</script>")
Return End If ds = search.query("select * from ruzhuinfo where 入住房间 = '" & TextBox1.Text & "' ") If ds.Tables(0).Rows.Count = 0 Then
Response.Write("<script language=javascript>alert('你输入的入住房间有误,请重新输入!')</script>")
Else
ds = search.query("select 客户姓名,证件号码,入住日期 from ruzhuinfo where 入住房间 = '" & TextBox1.Text & "' ")
TextBox8.Text = ds.Tables(0).Rows(0)(0)
TextBox2.Text = ds.Tables(0).Rows(0)(1)
TextBox3.Text = ds.Tables(0).Rows(0)(2) End If
Catch ex As Exception
Response.Write("<script>alert('操作失败,请重试!')</script>") End Try
End Sub Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim ds As Data.DataSet
Dim c As String
Dim a As Integer
Dim d As Integer
a = DateDiff("d", TextBox3.Text, TextBox4.Text)
ds = search.query("select * from kefaninfo where 房间号='" & TextBox1.Text & "'")
c = ds.Tables(0).Rows(0)(2)
Label3.Text = (a + 1) * c
d = (Label3.Text / 10)
search.update("update customerinfo set 积分='" & d & "'where 姓名='" & TextBox8.Text & "'")
search.insert("insert into log values('" & Now & "','" & userinfo.Userid & "','" & Label2.Text & "','" & Page.Request.UserHostAddress & "')")
search.insert("insert into countinfo(客户姓名,入住房间,入住日期,退房日期,结帐方式,应收帐款,收款日期,收款员) values('" & TextBox8.Text & "','" & TextBox1.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & DropDownList1.Text & "','" & Label3.Text & "','" & Label4.Text & "','" & Label5.Text & "')")
search.update("update kefaninfo set 状态='" & Label1.Text & "'where 房间号='" & TextBox1.Text & "'")
search.delete("delete * from ruzhuinfo where 入住房间='" & TextBox1.Text & "'")
End Sub Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Return
End Sub
End Class提示:在位置 0 处没有任何行
是怎么回事啊
Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
Response.Write("<script language=javascript>alert('请填写入住房间!!')</script>")
TextBox1.Focus()
Exit Sub
End If Session("name") = TextBox8.Text
Session("room") = TextBox1.Text Session("checkin") = TextBox3.Text
Session("out") = TextBox4.Text Session("total") = Label3.Text
Response.Redirect("print.aspx")
End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
search.init()
TextBox4.Text = Now
Label4.Text = Today
Label5.Text = userinfo.Userid
End Sub Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
Dim ds As New Data.DataSet
If TextBox1.Text = "" Then
Response.Write("<script language=javascript>alert('请输入房间号!')</script>")
Return End If ds = search.query("select * from ruzhuinfo where 入住房间 = '" & TextBox1.Text & "' ") If ds.Tables(0).Rows.Count = 0 Then
Response.Write("<script language=javascript>alert('你输入的入住房间有误,请重新输入!')</script>")
Else
ds = search.query("select 客户姓名,证件号码,入住日期 from ruzhuinfo where 入住房间 = '" & TextBox1.Text & "' ")
TextBox8.Text = ds.Tables(0).Rows(0)(0)
TextBox2.Text = ds.Tables(0).Rows(0)(1)
TextBox3.Text = ds.Tables(0).Rows(0)(2) End If
Catch ex As Exception
Response.Write("<script>alert('操作失败,请重试!')</script>") End Try
End Sub Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim ds As Data.DataSet
Dim c As String
Dim a As Integer
Dim d As Integer
a = DateDiff("d", TextBox3.Text, TextBox4.Text)
ds = search.query("select * from kefaninfo where 房间号='" & TextBox1.Text & "'")
c = ds.Tables(0).Rows(0)(2)
Label3.Text = (a + 1) * c
d = (Label3.Text / 10)
search.update("update customerinfo set 积分='" & d & "'where 姓名='" & TextBox8.Text & "'")
search.insert("insert into log values('" & Now & "','" & userinfo.Userid & "','" & Label2.Text & "','" & Page.Request.UserHostAddress & "')")
search.insert("insert into countinfo(客户姓名,入住房间,入住日期,退房日期,结帐方式,应收帐款,收款日期,收款员) values('" & TextBox8.Text & "','" & TextBox1.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & DropDownList1.Text & "','" & Label3.Text & "','" & Label4.Text & "','" & Label5.Text & "')")
search.update("update kefaninfo set 状态='" & Label1.Text & "'where 房间号='" & TextBox1.Text & "'")
search.delete("delete * from ruzhuinfo where 入住房间='" & TextBox1.Text & "'")
End Sub Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Return
End Sub
End Class提示:在位置 0 处没有任何行
是怎么回事啊
c = ds.Tables(0).Rows(0)(2)
这里没有查找到符合条件的记录