⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 printform.aspx.vb

📁 旅客信息管理、酒店客房管理、各种信息查询
💻 VB
字号:
'文件名:PrintForm.aspx.vb
Partial Class RoomManage_PrintForm
    Inherits System.Web.UI.Page
    Private Shared My旅客账单类型 As String = "旅客入住单"
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim MyForbidString As String = Session("MyForbid").ToString()
        If (MyForbidString.IndexOf("A7") > 1) Then
            Server.Transfer("~/SystemManage/AllErrorHelp.aspx")
        End If
        Me.Page.Title = "当前位置:客房管理->打印旅客账单"
    End Sub
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        '查询旅客入住单/结账单信息
        My旅客账单类型 = Me.DropDownList1.SelectedValue.ToString()
        Dim MySQL As String = ""
        Dim MySQLConnectionString As String = ConfigurationManager.ConnectionStrings("MyHotelDBConnectionString").ConnectionString
        If (My旅客账单类型 = "旅客入住单") Then
            MySQL = "Select * From 客房入住单 WHERE  入住房号 LIKE '%" + Me.TextBox1.Text + "%' OR 客人姓名 LIKE '%" + Me.TextBox2.Text + "%'"
            Me.SqlDataSource1.ConnectionString = MySQLConnectionString
            Me.SqlDataSource1.SelectCommand = MySQL
            Me.SqlDataSource1.DataBind()
            Me.GridView1.DataBind()
            Me.MultiView1.ActiveViewIndex = 0
        End If
        If (My旅客账单类型 = "旅客结账单") Then
            MySQL = "Select *From 客房结账单 WHERE  入住房号 LIKE '%" + Me.TextBox1.Text + "%' OR 客人姓名 LIKE '%" + Me.TextBox2.Text + "%'"
            Me.SqlDataSource2.ConnectionString = MySQLConnectionString
            Me.SqlDataSource2.SelectCommand = MySQL
            Me.SqlDataSource2.DataBind()
            Me.GridView2.DataBind()
            Me.MultiView1.ActiveViewIndex = 1
        End If
    End Sub
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        '打印旅客入住单/结账单信息        
        If (My旅客账单类型 = "旅客入住单") Then
            Dim My入住编号 As New HttpCookie("My入住编号")
            My入住编号.Value = Me.GridView1.SelectedRow.Cells(1).Text.ToString()
            Response.Cookies.Add(My入住编号)
            Dim My入住房号 As New HttpCookie("My入住房号")
            My入住房号.Value = Me.GridView1.SelectedRow.Cells(2).Text.ToString()
            Response.Cookies.Add(My入住房号)
            Dim My折扣价格 As New HttpCookie("My折扣价格")
            My折扣价格.Value = Me.GridView1.SelectedRow.Cells(3).Text.ToString()
            Response.Cookies.Add(My折扣价格)
            Dim My预收押金 As New HttpCookie("My预收押金")
            My预收押金.Value = Me.GridView1.SelectedRow.Cells(4).Text.ToString()
            Response.Cookies.Add(My预收押金)
            Dim My入住日期 As New HttpCookie("My入住日期")
            My入住日期.Value = DateTime.Parse(Me.GridView1.SelectedRow.Cells(5).Text.ToString()).ToShortDateString()
            Response.Cookies.Add(My入住日期)
            Dim My离开日期 As New HttpCookie("My离开日期")
            My离开日期.Value = DateTime.Parse(Me.GridView1.SelectedRow.Cells(6).Text.ToString()).ToShortDateString()
            Response.Cookies.Add(My离开日期)
            Dim My客人姓名 As New HttpCookie("My客人姓名")
            My客人姓名.Value = Me.GridView1.SelectedRow.Cells(7).Text.ToString()
            Response.Cookies.Add(My客人姓名)
            Dim My证件名称 As New HttpCookie("My证件名称")
            My证件名称.Value = Me.GridView1.SelectedRow.Cells(8).Text.ToString()
            Response.Cookies.Add(My证件名称)
            Dim My证件号码 As New HttpCookie("My证件号码")
            My证件号码.Value = Me.GridView1.SelectedRow.Cells(9).Text.ToString()
            Response.Cookies.Add(My证件号码)
            Dim My证件地址 As New HttpCookie("My证件地址")
            My证件地址.Value = Me.GridView1.SelectedRow.Cells(10).Text.ToString()
            Response.Cookies.Add(My证件地址)
            Dim My住宿人数 As New HttpCookie("My住宿人数")
            My住宿人数.Value = Me.GridView1.SelectedRow.Cells(11).Text.ToString()
            Response.Cookies.Add(My住宿人数)
            Dim My客人性别 As New HttpCookie("My客人性别")
            My客人性别.Value = Me.GridView1.SelectedRow.Cells(12).Text.ToString()
            Response.Cookies.Add(My客人性别)
            Dim My联系电话 As New HttpCookie("My联系电话")
            My联系电话.Value = Me.GridView1.SelectedRow.Cells(13).Text.ToString()
            Response.Cookies.Add(My联系电话)
            Dim My操作人员 As New HttpCookie("My操作人员")
            My操作人员.Value = Me.GridView1.SelectedRow.Cells(14).Text.ToString()
            Response.Cookies.Add(My操作人员)
            Dim My登记说明 As New HttpCookie("My登记说明")
            My登记说明.Value = Me.GridView1.SelectedRow.Cells(15).Text.ToString()
            Response.Cookies.Add(My登记说明)
            Server.Transfer("~/RoomManage/RegisterPrint.aspx")
        End If
        If (My旅客账单类型 = "旅客结账单") Then
            Server.Transfer("~/RoomManage/PrintPrint.aspx")
        End If
    End Sub
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint入住编号() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(2).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint入住房号() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(4).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint客人姓名() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(5).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint店内消费() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(8).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint住宿费() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(9).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint电话费() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(10).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint用餐费() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(11).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint预收押金() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(12).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint结账金额() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(13).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint结账编号() As String
        Get
            Return Me.GridView2.SelectedRow.Cells(3).Text.ToString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint结账日期() As String
        Get
            Dim MyDate As DateTime = DateTime.Parse(Me.GridView2.SelectedRow.Cells(7).Text.ToString())
            Return MyDate.ToShortDateString()
        End Get
    End Property
    '设置要传递到打印页的数据
    Public ReadOnly Property MyPrint入住日期() As String
        Get
            Dim MyDate As DateTime = DateTime.Parse(Me.GridView2.SelectedRow.Cells(6).Text.ToString())
            Return MyDate.ToShortDateString()
        End Get
    End Property
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -