日期:2014-05-17 浏览次数:20553 次
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetddlregionSource(); //区域的数据源
string pre = txtpredate.Value + " 00:00:00";
string next = txtnextdate.Value + " 23:59:59";
string regions = ddlregion.SelectedItem.Text;
AspNetPager1.RecordCount = JICHAManager.GetAspNetPagerCount(AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex,pre,next,regions); //加载时得到总页数
GetAspNetPagerSource(); //得到所有的记录
}
}
#region “得到地区的数据源”
public void GetddlregionSource()
{
IList<SEC_REGION> list = SEC_REGIONManager.GetAllRegion();
ddlregion.DataTextField = "REGION_NAME";
ddlregion.DataValueField = "REGION_ID";
ddlregion.DataSource = list;
ddlregion.DataBind();
ddlregion.Items.Insert(0, new ListItem("--全部--", "-1"));
}
#endregion
#region “提交”按钮
protected void btnsubmit_Click(object sender, EventArgs e)
{
AspNetPager1.CurrentPageIndex = 1;
string pre = txtpredate.Value + " 00:00:00";
string next = txtnextdate.Value + " 23:59:59";