📄 reportcardprint.aspx.cs
字号:
//文件名:ReportCardPrint.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;
//该源码下载自www.51aspx.com(51aspx.com)
using System.Data.SqlClient;
public partial class ReportManage_ReportCardPrint : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{//显示固定资产信息
string MyID = this.Request.Params["MyID"].ToString();
if (Session["MyCompanyName"] != null)
{
this.Label1.Text = Session["MyCompanyName"].ToString() + "固定资产档案卡";
}
this.Label2.Text = "打印日期:" + DateTime.Now.ToShortDateString();
string MyConnectionString = ConfigurationManager.ConnectionStrings["MyAssetsDBConnectionString"].ConnectionString; ;
string MySQL = "Select * From 基本档案 WHERE 资产编号 LIKE '" + MyID + "'";
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString);
DataTable MyFileTable = new DataTable();
MyAdapter.Fill(MyFileTable);
this.Label3.Text = "资产编号:" + MyID;
this.Label4.Text = "资产名称:" + MyFileTable.Rows[0][2].ToString();
this.Label5.Text = "规格型号:" + MyFileTable.Rows[0][3].ToString();
this.Label6.Text = "制造厂家:" + MyFileTable.Rows[0][4].ToString();
DateTime MyDate=(DateTime)MyFileTable.Rows[0][5];
this.Label7.Text = "出厂日期:" + MyDate.ToShortDateString();
MyDate = (DateTime)MyFileTable.Rows[0][6];
this.Label9.Text = "入账日期:" + MyDate.ToShortDateString();
this.Label8.Text = "存放地点:" + MyFileTable.Rows[0][7].ToString();
this.Label10.Text = "使用部门:" + MyFileTable.Rows[0][8].ToString();
this.Label11.Text = "使用状态:" + MyFileTable.Rows[0][9].ToString();
this.Label12.Text = "增加方式:" + MyFileTable.Rows[0][10].ToString();
this.Label13.Text = "所属类别:" + MyFileTable.Rows[0][11].ToString();
this.Label15.Text = "单位:" + MyFileTable.Rows[0][12].ToString();
this.Label14.Text = "数量:" + MyFileTable.Rows[0][13].ToString();
this.Label16.Text = "单价:" + MyFileTable.Rows[0][14].ToString();
this.Label17.Text = "金额:" + MyFileTable.Rows[0][15].ToString();
this.Label25.Text = "资产原值:" + MyFileTable.Rows[0][16].ToString();
this.Label18.Text = "累计折旧:" + MyFileTable.Rows[0][17].ToString();
this.Label23.Text = "折旧方法:" + MyFileTable.Rows[0][18].ToString();
this.Label20.Text = "折旧月数:" + MyFileTable.Rows[0][19].ToString();
this.Label21.Text = "已提月数:" + MyFileTable.Rows[0][20].ToString();
this.Label22.Text = "月度折旧额:" + MyFileTable.Rows[0][21].ToString();
this.Label19.Text = "预计净残值:" + MyFileTable.Rows[0][22].ToString();
this.Label24.Text = "补充说明:" + MyFileTable.Rows[0][23].ToString();
MySQL = "Select 设备名称,规格型号,生产厂家,单位,数量 From 附属设备 WHERE 资产编号 LIKE '" + MyID + "'";
MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString);
DataTable MyFittingsTable = new DataTable();
MyAdapter.Fill(MyFittingsTable);
this.GridView1.DataSource = MyFittingsTable;
this.GridView1.DataBind();
MySQL = "Select 送修日期,修理费用,修理公司,故障原因,修理情况 From 修理记录 WHERE 资产编号 LIKE '" + MyID + "'";
MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString);
DataTable MyRepairTable = new DataTable();
MyAdapter.Fill(MyRepairTable);
this.GridView2.DataSource = MyRepairTable;
this.GridView2.DataBind();
MySQL = "Select 租借公司,租借数量,计量单位,租借日期,实际收益 From 租借记录 WHERE 资产编号 LIKE '" + MyID + "'";
MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString);
DataTable MyLeaseTable = new DataTable();
MyAdapter.Fill(MyLeaseTable);
this.GridView3.DataSource = MyLeaseTable;
this.GridView3.DataBind();
if (Session["MyUserName"] != null)
{
this.Label31.Text = "设备员:" + Session["MyUserName"].ToString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -