chuqinManage.aspx.cs

(完整代码) 2KB

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 chuqinManage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["adminUserName"] == null)
            Response.Redirect("login.aspx");
        if (!IsPostBack)
        {
            this.Year.Items.Add(new ListItem("请选择年份","0"));
            for (int i = 2008; i <= 2030; i++)
                this.Year.Items.Add(new ListItem(i.ToString(),i.ToString()));
            this.Month.Items.Add(new ListItem("请选择月份","0"));
            for (int i = 1; i <= 12; i++)
                this.Month.Items.Add(new ListItem(i.ToString(),i.ToString()));
        }
    }
    protected void Btn_Query_Click(object sender, EventArgs e)
    {
        /*取得查询参数*/
        string year = this.Year.SelectedValue;
        string month = this.Month.SelectedValue;
        string employeeId = this.EmployeeId.Text;
        /*调用业务层进行处理*/
        ChuqinDAO chuqinDAO = new ChuqinDAO();
        this.GridView1.DataSource = chuqinDAO.QueryChuqin(employeeId, year, month);
        this.GridView1.DataSourceID = null;
        this.GridView1.PageIndex = 0;
        this.GridView1.DataBind();

    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {

        /*取得查询参数*/
        string year = this.Year.SelectedValue;
        string month = this.Month.SelectedValue;
        string employeeId = this.EmployeeId.Text;
        /*调用业务层进行处理*/
        ChuqinDAO chuqinDAO = new ChuqinDAO();
        this.GridView1.DataSource = chuqinDAO.QueryChuqin(employeeId, year, month);
        this.GridView1.DataSourceID = null;
        this.GridView1.PageIndex = e.NewPageIndex;
        this.GridView1.DataBind();
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。