📄 homechargefee.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 admin_areafacility : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToString(Session["code"]) == "")
{
Response.Redirect("login.aspx");
}
if (!IsPostBack)
{
this.bind();
}
}
public void bind()
{
BaseClass bc = new BaseClass();
string id = Session["code"].ToString();
string strsql = "select * from v_homefee where code=" + id + "order by ID desc";//视图中查询
// Response.Write(strsql);
// Response.End();
bc.ExecGridView(GridView1, strsql);//绑定数据
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string id = e.Row.Cells[6].Text.ToString();
int not = Convert.ToInt32(id);
if (not == 0)
{
e.Row.Cells[6].Text = "<font color=red>已结款</font>";
}
else
{
e.Row.Cells[6].Text = id;
}
e.Row.Cells[3].Text = Convert.ToDateTime(e.Row.Cells[3].Text).ToShortDateString();
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#99ccff';this.Style.color='buttontext';this.Style.cursor='default';");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';this.style.color='';");
}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.GridView1.PageIndex = e.NewPageIndex;
this.bind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
string id = GridView1.DataKeys[e.NewEditIndex].Value.ToString();
Response.Write("<script>window.open('feeinfo.aspx?id=" + id + "','','width=400,height=500,scrollbars=no')</script>");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -