private void MsgDataBind() { RatingBLL objl = new RatingBLL(); grdCus.DataSource = objl.GetAutoRateListByNick(txtTitle.Text.Trim(), txt_StartTime.Value, txt_EndTime.Value, drpSendType.SelectedValue); grdCus.DataBind(); }
protected void BindData() { RatingBLL objDal = new RatingBLL(); string startDate = datePickerStart.Value; string endDate = datePickerEnd.Value; DataTable ds = objDal.GetAutoRateListByNick(Users.Nick, startDate, endDate); //根据分页情况将数据写入或者更新到数据库 this.grdRateLogList.DataSource = ds; this.grdRateLogList.DataBind(); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string startDate = datePickerStart.Value; string endDate = datePickerEnd.Value; RatingBLL objDal = new RatingBLL(); DataTable tb = objDal.GetAutoRateListByNick(Users.Nick, startDate, endDate); try { if (tb != null && tb.Rows.Count > 0) { DownloadToExcel(tb); } else { Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script type='text/javascript' defer=defer>alert('没有可以导出的日期!');</script>"); } } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI); } }