📄 queryrepairform.aspx.cs
字号:
//文件名:QueryRepairForm.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 QueryManage_QueryRepairForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string MyForbidString = Session["MyForbid"].ToString();
if (MyForbidString.IndexOf("C2") > 1)
{
Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
}
}
protected void Button1_Click(object sender, EventArgs e)
{//查询送修的资产
string MyConnectionString = ConfigurationManager.ConnectionStrings["MyAssetsDBConnectionString"].ConnectionString; ;
SqlConnection MyConnection = new SqlConnection(MyConnectionString);
MyConnection.Open();
DataTable MyQueryTable = new DataTable();
string MySQL = "SELECT 基本档案.使用部门, 维修资产.资产编号, 维修资产.资产名称,维修资产.送修数量, 维修资产.计量单位, 维修资产.送修日期, 维修资产.预计完修日期, 维修资产.预计修理费用, 维修资产.修理公司, 维修资产.故障原因, 维修资产.修理情况, 维修资产.补充说明 FROM 基本档案 INNER JOIN 维修资产 ON 基本档案.资产编号 = 维修资产.资产编号 WHERE 送修日期 BETWEEN '" + this.TextBox1.Text + "' AND '" + this.TextBox2.Text + "'";
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
MyAdapter.Fill(MyQueryTable);
this.GridView1.DataSource = MyQueryTable;
this.GridView1.DataBind();
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
}
protected void Button2_Click(object sender, EventArgs e)
{//打印送修的资产
Server.Transfer("~/QueryManage/QueryRepairPrint.aspx");
}
public string MyPrintSQL
{//设置要传递到打印页的数据
get
{
return "SELECT 基本档案.使用部门, 维修资产.资产编号, 维修资产.资产名称,维修资产.送修数量, 维修资产.计量单位, 维修资产.送修日期, 维修资产.预计完修日期, 维修资产.预计修理费用, 维修资产.修理公司, 维修资产.故障原因, 维修资产.修理情况, 维修资产.补充说明 FROM 基本档案 INNER JOIN 维修资产 ON 基本档案.资产编号 = 维修资产.资产编号 WHERE 送修日期 BETWEEN '" + this.TextBox1.Text + "' AND '" + this.TextBox2.Text + "'";
}
}
public String MyPrintDate
{//设置要传递到打印页的数据
get
{
return "开始日期:" + this.TextBox1.Text + " 结束日期:" + this.TextBox2.Text;
}
}
public String MyPrintTitle
{//设置要传递到打印页的数据
get
{
return Session["MyCompanyName"].ToString() + "送修固定资产统计表";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -