📄 default.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 InquireSys_Default : System.Web.UI.Page
{
string perid = "";
string perpsw = "";
string pername = "";
string depid = "";
string persex = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["perid"].ToString() != "")
{
perid = Session["perid"].ToString();
perpsw = Session["perpsw"].ToString();
pername = Session["pername"].ToString();
depid = Session["perdepid"].ToString();
persex = Session["persex"].ToString();
Label1.Text = pername;
Label2.Text = persex;
//admin dep = new admin();
bill dep = new bill();
string depname = dep.depidinfo(depid, Page).Rows[0]["dename"].ToString();
Label3.Text = depname;
blind();
Label4.Text = notpaymoneyall();
}
else
{
Response.Redirect("~/error.aspx");
}
}
}
public void blind()
{
string id=perid;
person unpay = new person();
DataTable unpayed=unpay.unpayed(id,Page);
DataList1.DataSource = unpayed.DefaultView;
DataList1.DataBind();
}
public string notpaymoneyall()
{
double m=0;
for (int i = 0; i < DataList1.Items.Count; i++)
{
Label mm= DataList1.Items[i].FindControl("money") as Label;
m +=Convert .ToDouble( mm.Text);
}
return m.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
string id = Session["perid"].ToString();
person pay = new person();
DataTable payed = pay.payed(id, Page);
DataList1.DataSource = payed.DefaultView;
DataList1.DataBind();
}
protected void Button2_Click(object sender, EventArgs e)
{
string id = Session["perid"].ToString();
person pay = new person();
DataTable payed = pay.allconsum(id, Page);
DataList1.DataSource = payed.DefaultView;
DataList1.DataBind();
}
protected void Button4_Click(object sender, EventArgs e)
{
Response.Redirect("editdrug.aspx");
}
protected void Button5_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("~/Default.aspx");
}
protected void Button3_Click(object sender, EventArgs e)
{
string id = Session["perid"].ToString();
person pay = new person();
DataTable payed = pay.unpayed(id, Page);
DataList1.DataSource = payed.DefaultView;
DataList1.DataBind();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -