Beispiel #1
0
    public override void DataBind()
    {
        string sqlWhere = " 1=1 ";

        //string searchText = ttbSearchMessage.Text.Trim();
        if (!String.IsNullOrEmpty(txtdates.Text))
        {
            sqlWhere += string.Format(" And sendTime>'{0}'  ", Convert.ToDateTime(txtdates.Text));
        }
        if (!String.IsNullOrEmpty(txtDateE.Text))
        {
            sqlWhere += string.Format(" And sendTime<'{0}'  ", Convert.ToDateTime(txtDateE.Text).AddDays(1));
        }
        if (drptype.SelectedValue != "0")
        {
            sqlWhere += string.Format(" And type='{0}'", drptype.SelectedValue);
        }

        int s = Pager.PageSize * (Pager.CurrentPageIndex - 1);
        int e = Pager.PageSize * Pager.CurrentPageIndex;

        DataTable dt = bll.GetListByPage(sqlWhere, " id ", s, e).Tables[0];

        Pager.RecordCount          = bll.GetRecordCount(sqlWhere);
        CompanyRepeater.DataSource = dt;
        CompanyRepeater.DataBind();

        base.DataBind();
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager.RegisterClientScriptInclude(Page, Page.GetType(), "popUpListHandler", ResolveClientUrl("~/javascript/popUpListHandler.js"));
        ScriptManager.RegisterClientScriptInclude(Page, Page.GetType(), "advancedCheckBoxListHandler", ResolveClientUrl("~/javascript/advancedCheckBoxListHandler.js"));

        if (!IsPostBack)
        {
            ArrayList list = ECompany.db.select(dbConn, new DBFilter());
            CompanyRepeater.DataSource = list;
            CompanyRepeater.DataBind();
        }
    }