reportchargeform.aspx.cs

来自「小区物业管理系统源代码,密码:123456,」· CS 代码 · 共 63 行

CS
63
字号
//文件名:ReportChargeForm.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Data.SqlClient;
public partial class ReportManage_ReportChargeForm : System.Web.UI.Page
{
    private static DataTable MyTable = new DataTable();
    protected void Page_Load(object sender, EventArgs e)
    {
        string MyForbidString = Session["MyForbid"].ToString();
        if (MyForbidString.IndexOf("D5") > 1)
        {
            Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {//查询物管收费信息
        MyTable.Rows.Clear();
        string MySQL = "Select * FROM 费用收据 WHERE (收款日期 BETWEEN '" + this.TextBox1.Text + "' AND '" + this.TextBox2.Text + "') AND (收款事由 LIKE '%" + this.TextBox3.Text + "%')";
        String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyCommunityDBConnectionString"].ConnectionString;
        SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);
        MyConnection.Open();
        SqlDataAdapter MyAdatper = new SqlDataAdapter(MySQL, MyConnection);
        MyAdatper.Fill(MyTable);
        this.GridView1.DataSource = MyTable;
        this.GridView1.DataBind();  
    }
    protected void Button2_Click(object sender, EventArgs e)
    {//打印物管收费信息
        Server.Transfer("~/ReportManage/ReportChargePrint.aspx"); 
    }
    public DataTable MyQueryTable
    {//设置要传递到打印页的数据
        get
        {
            return MyTable;
        }
    }
    public String MyPrintDate
    {//设置要传递到打印页的数据
        get
        {
            return "打印日期:" + DateTime.Now.ToShortDateString() + " 查询条件:开始日期[" + this.TextBox1.Text + "],结束日期[" + this.TextBox2.Text + "],收款事由[" + this.TextBox3.Text + "]";
        }
    }
    public String MyPrintTitle
    {//设置要传递到打印页的数据
        get
        {
            return Session["MyCommunityName"].ToString() + "物管收费情况表";
        }
    }
}

⌨️ 快捷键说明

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