12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System;
- using System.Collections;
- using System.Configuration;
- using System.Data;
- //using System.Linq;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- //using System.Xml.Linq;
- namespace Com.Jpsoft.Hospital.Web.Module.rs_ygxx
- {
- public partial class List : Com.Jpsoft.Hospital.Web.Common.BasePage
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- int iCurPage = 1;
- FetchQueryString("LCurPage", out iCurPage);
- AspNetPager1.RecordCount = iCurPage * AspNetPager1.PageSize;
- AspNetPager1.CurrentPageIndex = iCurPage;
- BindData();
- }
- }
- private void BindData()
- {
- int RecordCount = 0;
- string strWhere = " where 1=1 ";
- if (!string.IsNullOrEmpty(this.txthzxm.Text))
- {
- strWhere += " and name like '%" + this.txthzxm.Text + "%' ";
- }
- if (!string.IsNullOrEmpty(this.txtygdm.Text))
- {
- strWhere += " and gh='" + this.txtygdm.Text + "' ";
- }
- if (!string.IsNullOrEmpty(this.txtMobile.Text))
- {
- strWhere += " and mobile='" + this.txtMobile.Text + "' ";
- }
- if (!string.IsNullOrEmpty(this.txtPhone.Text))
- {
- strWhere += " and phone='" + this.txtPhone.Text + "' ";
- }
- string strOrder = " order by id DESC";
- Com.Jpsoft.Hospital.BLL.rs_ygxxEx bll = new Com.Jpsoft.Hospital.BLL.rs_ygxxEx();
- using (IDataReader idr = bll.SelectPage4rsdata(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 Button1_Click(object sender, EventArgs e)
- {
- this.AspNetPager1.CurrentPageIndex = 0;
- BindData();
- }
- protected void AspNetPager1_PageChanged(object sender, EventArgs e)
- {
- BindData();
- }
- }
- }
|