salaryManage.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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 Salary.Model;
using Salary.DAO;

public partial class salaryManage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["adminUserName"] == null)
            Response.Redirect("login.aspx");
        if (!IsPostBack)
        {
            this.SearchYear.Items.Add(new ListItem("选择年份", "0"));
            for (int i = 2008; i <= 2030; i++)
                this.SearchYear.Items.Add(new ListItem(i.ToString(), i.ToString()));
            this.SearchMonth.Items.Add(new ListItem("选择月份", "0"));
            for (int i = 1; i <= 12; i++)
                this.SearchMonth.Items.Add(new ListItem(i.ToString(), i.ToString()));
            this.DepartmentId.Items.Add(new ListItem("选择部门", "0"));
            DepartmentDAO departmentDAO = new DepartmentDAO();
            ArrayList departmentList = departmentDAO.QueryAllDepartment();
            for (int i = 0; i < departmentList.Count; i++)
            {
                Department department = (Department)departmentList[i];
                this.DepartmentId.Items.Add(new ListItem(department.getDepartmentName(), department.getDepartmentId().ToString()));
            }
        }
    }
    protected void Btn_Query_Click(object sender, EventArgs e)
    {
        string employeeId = this.EmployeeId.Text;
        string searchYear = this.SearchYear.SelectedValue;
        string searchMonth = this.SearchMonth.SelectedValue;
        string departmentId = this.DepartmentId.SelectedValue;
        SalaryDAO salaryDAO = new SalaryDAO();
        this.GridView1.DataSource = salaryDAO.QuerySalaryInfo(searchYear, searchMonth, employeeId, departmentId);
        this.GridView1.DataSourceID = null;
        this.GridView1.PageIndex = 0;
        this.GridView1.DataBind();
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        string employeeId = this.EmployeeId.Text;
        string searchYear = this.SearchYear.SelectedValue;
        string searchMonth = this.SearchMonth.SelectedValue;
        string departmentId = this.DepartmentId.SelectedValue;
        SalaryDAO salaryDAO = new SalaryDAO();
        this.GridView1.DataSource = salaryDAO.QuerySalaryInfo(searchYear, searchMonth, employeeId, departmentId);
        this.GridView1.DataSourceID = null;
        this.GridView1.PageIndex = e.NewPageIndex;
后面还有 3 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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