日期:2014-05-17 浏览次数:20481 次
protected void lnkbtnPre_Click(object sender, EventArgs e) { if (this.TeacherInfoList.PageIndex > 0) { this.TeacherInfoList.PageIndex = this.TeacherInfoList.PageIndex - 1; bind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { this.AspNetPager1.PageSize = Const.PageSize; this.BindConsumer(); } } private void BindConsumer() { string[] keys = new string[] { "CRID", "IsDetail" }; Dictionary<string, object> dictionary = this.GetQueryDictionary(); if (dictionary != null) { int recordCount; DataSet ds = (new ZYIOT.CR.BLL.Consumer.V_CR_ConsumerForUser()).GetPageList(this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex - 1, null, out recordCount, dictionary); this.AspNetPager1.RecordCount = recordCount; if (recordCount > 0) { Method.BindGridView(this.GridView1, keys, ds.Tables[0].DefaultView); return; } } this.AspNetPager1.RecordCount = 0; Method.BindGridView(this.GridView1, keys, null); } /// <summary> /// 生成查询字典 /// </summary> /// <returns></returns> private Dictionary<string, object> GetQueryDictionary() { Dictionary<string, object> dictionary = new Dictionary<string, object>(); DateTime dt; //开始日期范围 if (!string.IsNullOrEmpty(this.txtBuyTimeStartQuery.Text.Trim())) { if (DateTime.TryParse(this.txtBuyTimeStartQuery.Text.Trim(), out dt)) { dictionary.Add("BuyTimeStart", dt.Date); } else { this.ReSetStartDate(); dictionary.Add("BuyTimeStart", System.DateTime.Now.Date.AddDays(1 - System.DateTime.Now.Day)); } } return dictionary; }