62,025
社区成员
发帖
与我相关
我的任务
分享
private string state = "1";
private BLL.LeaveInfo lea_bll = new BLL.LeaveInfo();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
leave_status();
Get_LeaveInfo();
}
}
public void leave_status()
{
this.ddl_status.Items.Add(new ListItem("未审核", "1"));
this.ddl_status.Items.Add(new ListItem("已批准", "2"));
this.ddl_status.Items.Add(new ListItem("已否决", "3"));
}
public void Get_LeaveInfo()
{
int count = 0;
this.rp_list.DataSource = lea_bll.GetList(this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, "lid", true, " l_state='" + state + "'", out count);
this.rp_list.DataBind();
this.AspNetPager1.RecordCount = count;
AspNetPager1.CustomInfoHTML = "<font color='#000'>记录总数:</font><font color=\"blue\"><b>" + AspNetPager1.RecordCount.ToString() + " </b></font>";
AspNetPager1.CustomInfoHTML += "<font color='#000'>总页数:</font><font color=\"blue\"><b>" + AspNetPager1.PageCount.ToString() + " </b></font>";
AspNetPager1.CustomInfoHTML += "<font color='#000'>当前页:</font><font color=\"red\"><b>" + AspNetPager1.CurrentPageIndex.ToString() + " </b></font>";
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.ddl_status.SelectedValue))
{
state = this.ddl_status.SelectedValue;
}
this.Get_LeaveInfo();
}
protected void Query_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.ddl_status.SelectedValue))
{
state = this.ddl_status.SelectedValue;
}
AspNetPager1.CurrentPageIndex = 1;
Get_LeaveInfo();
}