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

📄 hecha.aspx.vb

📁 一个报税管理系统AJAX第二版B-S.rar
💻 VB
字号:
Imports System.Data.SqlClient
Imports system.configuration
Imports System.Web.Configuration
Imports System.Data
Partial Class hecha
    Inherits System.Web.UI.Page
    Public pulic As New pulic1
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        If IsValid Then
            chushihua()
            Dim da = Mid(TextBox1.Text, 1, 4) + Mid(TextBox1.Text, 6, 2) + Mid(TextBox1.Text, 9, 2)
            Dim db = Mid(TextBox2.Text, 1, 4) + Mid(TextBox2.Text, 6, 2) + Mid(TextBox2.Text, 9, 2)
            Dim grid1 = ""
            Dim grid2 = ""
            Dim grid3 = ""
            Dim grid4 = ""
            If Session("s") = "" Then
                grid1 = "select hc_fpxm.nsrid as 纳税人编号,hc_fpxm.riqi as 开票日期,hc_fpxm.fpdm as 发票代码,hc_fpxm.fph as 发票号码,hc_fpxm.hjzje as 发票总金额,hc_fpxm.type as 开票类型,hc_fpxm.xms as 商品项目数,hc_fpxm.pay as 付款单位" & _
            ",hc_fpxm.receiver as 收款员,hc_fpxm.fph as 原发票号码 from  hc_fpxm,nsrinf  where nsrinf.nsrid=hc_fpxm.nsrid  and hc_fpxm.riqi between " + da.ToString.Trim + " And   " + db.ToString.Trim
                grid2 = "select hc_fpxm.nsrid as 纳税人编号,hc_fpxm.riqi as 开票日期,hc_fpxm.fpdm as 发票代码,hc_fpxm.fph as 发票号码,hc_fpxm.xm1 as 项目一名称,hc_fpxm.xm1sl as 项目一数量,hc_fpxm.xm1dj as 项目一单价,hc_fpxm.xm1je as 项目一金额" & _
               " from  hc_fpxm,nsrinf  where nsrinf.nsrid=hc_fpxm.nsrid and hc_fpxm.riqi between " + da.ToString.Trim + " And   " + db.ToString.Trim
                grid3 = "select hc_rjy.nsrid as 纳税人编号,hc_rjy.riqi as 交易日期,hc_rjy.fpok as 正常发票数,hc_rjy.fptui as 退票数,hc_rjy.fpfei as 废票数" & _
                    ",hc_rjy.ok as 正常票金额,hc_rjy.fei as 退票金额 from  hc_rjy,nsrinf  where nsrinf.nsrid=hc_rjy.nsrid and hc_rjy.riqi between " + da.ToString.Trim + " And   " + db.ToString.Trim
                grid4 = "select hc_rjy.nsrid as 纳税人编号,hc_rjy.riqi as 交易日期,hc_rjy.fpok as 正常票数,hc_rjy.fptui as 退票数,hc_rjy.fpfei as 废票数 ,hc_rjy.ok1 as 税种1正常票金额" & _
                       ",hc_rjy.fei1 as 税种1退票金额,hc_rjy.ok2 as 税种2正常票金额,hc_rjy.fei2 as 税种2退票金额 ,hc_rjy.ok3 as 税种3正常票金额,hc_rjy.fei3 as 税种3退票金额 ,hc_rjy.ok4 as 税种4正常票金额,hc_rjy.fei4 as 税种4退票金额 ,hc_rjy.ok5 as 税种5正常票金额,hc_rjy.fei5 as 税种5退票金额 ,hc_rjy.ok6 as 税种6正常票金额,hc_rjy.fei6 as 税种6退票金额" & _
               " from  hc_rjy,nsrinf  where nsrinf.nsrid=hc_rjy.nsrid and hc_rjy.riqi between " + da.ToString.Trim + " And   " + db.ToString.Trim
            Else
                grid1 = "select hc_fpxm.nsrid as 纳税人编号,hc_fpxm.riqi as 开票日期,hc_fpxm.fpdm as 发票代码,hc_fpxm.fph as 发票号码,hc_fpxm.hjzje as 发票总金额,hc_fpxm.type as 开票类型,hc_fpxm.xms as 商品项目数,hc_fpxm.pay as 付款单位" & _
        ",hc_fpxm.receiver as 收款员,hc_fpxm.fph as 原发票号码 from  hc_fpxm,nsrinf  where nsrinf.nsrid=hc_fpxm.nsrid  and hc_fpxm.riqi between " + da.ToString.Trim + " And   " + db.ToString.Trim + " and " & Session("s")
                grid2 = "select hc_fpxm.nsrid as 纳税人编号,hc_fpxm.riqi as 开票日期,hc_fpxm.fpdm as 发票代码,hc_fpxm.fph as 发票号码,hc_fpxm.xm1 as 项目一名称,hc_fpxm.xm1sl as 项目一数量,hc_fpxm.xm1dj as 项目一单价,hc_fpxm.xm1je as 项目一金额" & _
                         " from  hc_fpxm,nsrinf  where nsrinf.nsrid=hc_fpxm.nsrid and hc_fpxm.riqi between " + da.ToString.Trim + " And   " + db.ToString.Trim + " and " & Session("s")
                grid3 = "select hc_rjy.nsrid as 纳税人编号,hc_rjy.riqi as 交易日期,hc_rjy.fpok as 正常发票数,hc_rjy.fptui as 退票数,hc_rjy.fpfei as 废票数" & _
                     ",hc_rjy.ok as 正常票金额,hc_rjy.fei as 退票金额 from  hc_rjy,nsrinf  where nsrinf.nsrid=hc_rjy.nsrid and hc_rjy.riqi between " + da.ToString.Trim + " And   " + db.ToString.Trim + " and " & Session("s")
                grid4 = "select hc_rjy.nsrid as 纳税人编号,hc_rjy.riqi as 交易日期,hc_rjy.fpok as 正常票数,hc_rjy.fptui as 退票数,hc_rjy.fpfei as 废票数 ,hc_rjy.ok1 as 税种1正常票金额" & _
               ",hc_rjy.fei1 as 税种1退票金额,hc_rjy.ok2 as 税种2正常票金额,hc_rjy.fei2 as 税种2退票金额 ,hc_rjy.ok3 as 税种3正常票金额,hc_rjy.fei3 as 税种3退票金额 ,hc_rjy.ok4 as 税种4正常票金额,hc_rjy.fei4 as 税种4退票金额 ,hc_rjy.ok5 as 税种5正常票金额,hc_rjy.fei5 as 税种5退票金额 ,hc_rjy.ok6 as 税种6正常票金额,hc_rjy.fei6 as 税种6退票金额" & _
       " from  hc_rjy,nsrinf  where nsrinf.nsrid=hc_rjy.nsrid and hc_rjy.riqi between " + da.ToString.Trim + " And   " + db.ToString.Trim

            End If
            Dim tiaojian = ""
            If TextBox1.Text <> "" Then
                tiaojian = " and nsrinf.nsrname like '%" + TextBox1.Text().Trim + "%'"
            End If
            If TextBox2.Text <> "" Then
                tiaojian = "and  nsrinf.nsrid like '%" + TextBox2.Text().Trim + "%'"
            End If
            Session("fpxm") = grid1 + tiaojian
            Session("fpxm2") = grid2 + tiaojian
            Session("tongji") = grid3 + tiaojian + " ORDER BY hc_rjy.nsrid ASC"
            Session("shuimu") = grid4 + tiaojian + " ORDER BY hc_rjy.nsrid ASC"
            System.Threading.Thread.Sleep(800)
            If pulic.execute(Session("fpxm")).HasRows Then
                pulic.selectcommand(GridView1, sql1, grid1)
                GridView1.AllowSorting = True
                GridView1.AllowPaging = True
                GridView1.DataBind()

            Else
                ' MsgBox("无相关信息!", 0, "提示:")
                Label9.Text = "提示:无匹配信息"
                Label9.Visible = True
                TextBox3.Text = ""
                TextBox4.Text = ""
            End If

            If pulic.execute(Session("fpxm2")).HasRows Then
                pulic.selectcommand(GridView2, sql2, grid2)
                GridView2.AllowSorting = True
                GridView2.AllowPaging = True
                GridView2.DataBind()
            Else
                Exit Sub
            End If
            If pulic.execute(Session("tongji")).HasRows Then
                pulic.selectcommand(GridView3, sql3, grid3)
                GridView3.AllowSorting = True
                GridView3.AllowPaging = True
                GridView3.DataBind()
            Else
                Exit Sub
            End If
            If pulic.execute(Session("shuimu")).HasRows Then
                pulic.selectcommand(GridView4, sql4, grid4)
                GridView4.AllowSorting = True
                GridView4.AllowPaging = True
                GridView4.DataBind()
            Else
                Exit Sub
            End If
        Else
            Exit Sub
        End If


    End Sub

    Protected Sub rdoCar_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoCar.SelectedIndexChanged
        For I As Integer = 0 To rdoCar.Items.Count - 1
            If rdoCar.Items(I).Selected Then
                MultiView1.ActiveViewIndex = CType(rdoCar.Items(I).Value, Int16)
            End If
        Next
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Response.Redirect("index.aspx")
    End Sub
    Protected Sub rdocar1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoCar1.SelectedIndexChanged
        For I As Integer = 0 To rdoCar1.Items.Count - 1
            If rdoCar1.Items(I).Selected Then
                MultiView2.ActiveViewIndex = CType(rdoCar1.Items(I).Value, Int16)
            End If
        Next
    End Sub
    Protected Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate
        Dim st1 = Mid(TextBox1.Text, 1, 4) + Mid(TextBox1.Text, 6, 2) + Mid(TextBox1.Text, 9, 2)
        Dim sp1 = Mid(TextBox2.Text, 1, 4) + Mid(TextBox2.Text, 6, 2) + Mid(TextBox2.Text, 9, 2)
        If (st1 > sp1) Or (TextBox1.Text.Trim.Length <> 10) Or (TextBox2.Text.Trim.Length <> 10) Then
            args.IsValid = False
        Else
            args.IsValid = True
        End If
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Session("bz") = "" Then
            Response.Redirect("login.aspx")
        End If

        If (Not IsPostBack) Then
            chushihua()
        End If
    End Sub
    Protected Sub chushihua()
        Label9.Visible = False
        GridView1.DataSource = ""
        GridView1.DataBind()
        GridView2.DataSource = ""
        GridView2.DataBind()
        GridView3.DataSource = ""
        GridView3.DataBind()
        GridView4.DataSource = ""
        GridView4.DataBind()
        TextBox1.Text = Format(Now(), "yyyy-MM-dd")
        TextBox2.Text = Format(Now(), "yyyy-MM-dd")
    End Sub
    Protected Sub GridView1_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GridView1.Sorting
        GridView1.AllowSorting = True
        GridView1.AllowPaging = True
    End Sub
    Protected Sub GridView2_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GridView2.Sorting
        GridView2.AllowSorting = True
        GridView2.AllowPaging = True
    End Sub
    Protected Sub GridView3_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GridView3.Sorting
        GridView3.AllowSorting = True
        GridView3.AllowPaging = True
    End Sub
    Protected Sub GridView4_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GridView4.Sorting
        GridView4.AllowSorting = True
        GridView4.AllowPaging = True
    End Sub
    Protected Sub gridview1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.DataBound
        DisplayPageNo(GridView1)
    End Sub
    Protected Sub gridview2_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView2.DataBound
        DisplayPageNo(GridView2)
    End Sub
    Protected Sub gridview3_databound(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView3.DataBound
        DisplayPageNo(GridView3)
    End Sub
    Protected Sub gridview4_databound(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView4.DataBound
        DisplayPageNo(GridView4)
    End Sub
    Protected Sub DisplayPageNo(ByVal gridview)

        If gridview.datasourceid <> "" Then
            Dim bottonPagerNo3 As New Label()
            Dim bottonPagerRow As GridViewRow = gridview.BottomPagerRow
            bottonPagerNo3.Text = "目前所在页码(" & (gridview.PageIndex & 1) & "/" & gridview.PageCount & ")"
            If gridview.PageCount <> "1" Then
                bottonPagerRow.Cells(0).Controls.Add(bottonPagerNo3)
            Else
                Exit Sub
            End If
        End If
    End Sub
End Class

⌨️ 快捷键说明

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