reportdepreciationform.aspx.cs

来自「重庆某纸业公司的固定资产管理系统」· CS 代码 · 共 62 行

CS
62
字号
//文件名:ReportDepreciationForm.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_ReportDepreciationForm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string MyForbidString = Session["MyForbid"].ToString();
        if (MyForbidString.IndexOf("D2") > 1)
        {
            Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {//查询固定资产折旧信息
        string MyID = this.DropDownList3.SelectedValue.ToString();
        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.GridView1.DataSource = MyFileTable;
        this.GridView1.DataBind();
        this.Label1.Text = this.DropDownList3.SelectedItem.Text + "累计折旧信息";
    }
    protected void Button2_Click(object sender, EventArgs e)
    {//打印固定资产折旧信息
        Server.Transfer("~/ReportManage/ReportDepreciationPrint.aspx");
    }
    public string MyPrintSQL
    {//设置要传递到打印页的数据
        get
        {
            return "Select 折旧年份,折旧月份,折旧方法,月度折旧额,补充说明 From 累计折旧表 WHERE 资产编号 LIKE '" + this.DropDownList3.SelectedValue.ToString() + "'";
        }
    }
    public String MyPrintDate
    {//设置要传递到打印页的数据
        get
        {
            return "打印日期:"+DateTime.Now.ToShortDateString()+"   资产编号:" + this.DropDownList3.SelectedValue.ToString() + "   资产名称:" + this.DropDownList3.SelectedItem.Text +"    使用部门:"+this.DropDownList2.SelectedValue.ToString();
        }
    }
    public String MyPrintTitle
    {//设置要传递到打印页的数据
        get
        {
            return Session["MyCompanyName"].ToString() + "固定资产累计折旧统计表";
        }
    }
}

⌨️ 快捷键说明

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