using System; using System.Collections.Generic; using System.Data; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Com.Jpsoft.Hospital.Web.Module.MsgRecord { public partial class Detail : Com.Jpsoft.Hospital.Web.Common.BasePage { protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) BindData(); } private void BindData() { int RecordCount = 0; string strWhere = " where 1=1"; if (ViewState["SearchTerms"] != null) { strWhere = ViewState["SearchTerms"].ToString(); } string strOrder = " order by d_id DESC"; using (IDataReader idr = Com.Jpsoft.Hospital.DAL.jp_msg_sendrecordEx.SelectPage(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, strWhere, strOrder)) { if (idr.Read()) { RecordCount = Convert.ToInt32(idr["RecordCount"]); } idr.NextResult(); GridView1.DataSource = idr; GridView1.DataBind(); } this.AspNetPager1.RecordCount = RecordCount; } protected void AspNetPager1_PageChanged(object sender, EventArgs e) { BindData(); } public string GetBoolCN(object obj) { bool bl; if (bool.TryParse(obj.ToString(), out bl)) { if (bl) return "成功"; else return "失败"; } return "未知"; } } }