using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL.Inquiry; using CY.Infrastructure.Query; using CY.Model; using CY.Infrastructure.Common; namespace CY.WebForm.Pages.sysInquiry { public partial class PaperInfoList : BasePage { #region 变量 PaperInfoBLL _paperInfoBLL = new PaperInfoBLL(); PaperTypeBLL _paperTypeBLL = new PaperTypeBLL(); #endregion #region 属性 #endregion #region 方法 private void BindBrandList() { Pagination pa = new Pagination(); pa.PageSize = UCPager1.AspNetPager.PageSize; pa.PageIndex = UCPager1.AspNetPager.CurrentPageIndex; int paperTypeId = -1; if (this.ddlPaperType.SelectedValue != "-1") { paperTypeId = this.ddlPaperType.SelectedValue.ToInt32().Value; } string stauts = ddlStatus.SelectedValue.ToString(); this.RepPaperInfoList.DataSource = _paperInfoBLL.GetPaperListByPaging(this.txtPagerName.Value, paperTypeId,stauts, pa); this.RepPaperInfoList.DataBind(); UCPager1.AspNetPager.RecordCount = pa.RecordCount; } private void BindPaperType() { IEnumerable typeList = _paperTypeBLL.GetPaperTypeList(); this.ddlPaperType.DataSource = typeList; this.ddlPaperType.DataTextField = "PaperTypeName"; this.ddlPaperType.DataValueField = "KeyId"; this.ddlPaperType.DataBind(); this.ddlPaperType.Items.Insert(0, new ListItem("全部","-1")); } #endregion #region 事件 /// /// 初始化 /// /// /// protected void Page_Load(object sender, EventArgs e) { this.UCPager1.AspNetPager.PageChanged += new EventHandler(AspNetPager1_PageChanged); if (!IsPostBack) { BindPaperType(); BindBrandList(); } } /// /// 分页事件 /// /// /// protected void AspNetPager1_PageChanged(object src, EventArgs e) { BindBrandList(); } /// /// 查询事件 /// /// /// protected void btn_Query_Click(object sender, EventArgs e) { BindBrandList(); } /// /// 重置事件 /// /// /// protected void btnReSet_Click(object sender, EventArgs e) { this.txtPagerName.Value = string.Empty; UCPager1.AspNetPager.CurrentPageIndex = 1; BindBrandList(); } #endregion } }