📄 gaspaymentprint.aspx.cs
字号:
//文件名:GasPaymentPrint.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;
public partial class ChargeManage_GasPaymentPrint : System.Web.UI.Page
{
private ChargeManage_GasPaymentForm MyPrintForm;
private static DataTable MyPrintTable = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{//打印水电气费信息
if (Session["MyCommunityName"] != null)
{
this.Label1.Text = Session["MyCommunityName"].ToString() + "水电气费收据";
}
MyPrintForm = (ChargeManage_GasPaymentForm)Context.Handler;
this.Label2.Text = "收款日期:" + MyPrintForm.MyPrint收款日期;
this.Label3.Text = "收据编号:" + MyPrintForm.MyPrint收据编号;
this.Label4.Text = "交款人员:" + MyPrintForm.MyPrint交款人员;
this.Label5.Text = "收款金额:" + MyPrintForm.MyPrint收款金额+"元";
this.Label6.Text = "收款形式:" + MyPrintForm.MyPrint收款形式;
this.Label8.Text = "收款事由:" + MyPrintForm.MyPrint收款事由;
this.Label9.Text = "收款人员:" + MyPrintForm.MyPrint收款人员;
this.Label7.Text = "补充说明:" + MyPrintForm.MyPrint补充说明;
//创建无连接的数据表
DataColumn[] MyKey = new DataColumn[1];
MyPrintTable = new DataTable("水电气费明细表");
DataColumn MyColumn = new DataColumn();
MyColumn.DataType = System.Type.GetType("System.Int16");
MyColumn.ColumnName = "序号";
MyPrintTable.Columns.Add(MyColumn);
MyKey[0] = MyColumn;
MyPrintTable.PrimaryKey = MyKey;
MyPrintTable.Columns.Add("年份", System.Type.GetType("System.Int16"));
MyPrintTable.Columns.Add("月份", System.Type.GetType("System.Int16"));
MyPrintTable.Columns.Add("类型", System.Type.GetType("System.String"));
MyPrintTable.Columns.Add("表号", System.Type.GetType("System.String"));
MyPrintTable.Columns.Add("底数", System.Type.GetType("System.Double"));
MyPrintTable.Columns.Add("止数", System.Type.GetType("System.Double"));
MyPrintTable.Columns.Add("用量", System.Type.GetType("System.Double"));
MyPrintTable.Columns.Add("单价", System.Type.GetType("System.Double"));
MyPrintTable.Columns.Add("金额", System.Type.GetType("System.Double"));
MyPrintTable.Rows.Clear();
int MyID = 0;
foreach (DataRow MyPrintRow in MyPrintForm.MyPrintDataTable.Rows)
{
DataRow MyRow = MyPrintTable.NewRow();
MyID += 1;
MyRow[0] =MyID;
MyRow[1] = MyPrintRow[1];
MyRow[2] = MyPrintRow[2];
MyRow[3] = MyPrintRow[3];
MyRow[4] = MyPrintRow[4];
MyRow[5] = MyPrintRow[5];
MyRow[6] = MyPrintRow[6];
MyRow[7] = MyPrintRow[7];
MyRow[8] = MyPrintRow[8];
MyRow[9] = MyPrintRow[9];
MyPrintTable.Rows.Add(MyRow);
}
this.GridView1.DataSource = MyPrintTable;
this.GridView1.DataBind();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -