Пример #1
0
    private void BindList()
    {
        int    pagesize = Convert.ToInt32(drp_pagesize.SelectedValue);
        string search   = "";

        if (txt_search.Text != "")
        {
            search = txt_search.Text;
        }

        //if (this.TotalRecords == 0)
        this.TotalRecords = CommentsBLL.Count_Comments(search, this.UserName, drp_type.SelectedValue, Convert.ToInt32(drp_isenable.SelectedValue), Convert.ToInt32(drp_approve.SelectedValue), Convert.ToInt32(drp_filter.SelectedValue));

        if (this.TotalRecords == 0)
        {
            // no record exist
            pnl_main.Visible      = false;
            pnl_norecord.Visible  = true;
            lbl_records.InnerHtml = "<h4>0 records found</h4>";
            return;
        }

        List <Comment_Struct> list = CommentsBLL.Load_Comments(search, this.UserName, drp_type.SelectedValue, Convert.ToInt32(drp_isenable.SelectedValue), Convert.ToInt32(drp_approve.SelectedValue), Convert.ToInt32(drp_filter.SelectedValue), drp_order.SelectedValue, this.PageNumber, pagesize);

        if (list.Count > 0)
        {
            ViewState["script_value"] = "";
            //int count = int.Parse(list.Count.ToString());
            if (this.TotalRecords > 1)
            {
                lbl_records.InnerHtml = "<h4>" + this.TotalRecords + " records found</h4>";
            }
            else
            {
                lbl_records.InnerHtml = this.TotalRecords + " record found";
            }
            // setup pagination
            Pagination_Process.Process_Pagination(MyList, rptPages, lnk_Prev, lnk_Next, pagesize, this.PageNumber, list, this.TotalRecords);

            pnl_main.Visible     = true;
            pnl_norecord.Visible = false;
        }
        else
        {
            pnl_main.Visible      = false;
            pnl_norecord.Visible  = true;
            lbl_records.InnerHtml = "<h4>0 records found</h4>";
        }
    }
Пример #2
0
    private void BindList()
    {
        DataSet ds = AdsBLL.Load_Ads(int.Parse(drp_sorttype.SelectedValue));

        if (ds.Tables[0].Rows.Count > 0)
        {
            Pagination_Process.Process_Pagination(MyList, rptPages, lnk_Prev, lnk_Next, 40, this.PageNumber, ds.Tables[0].DefaultView);
            pnl_main.Visible     = true;
            pnl_norecord.Visible = false;
        }
        else
        {
            pnl_main.Visible     = false;
            pnl_norecord.Visible = true;
        }
    }
Пример #3
0
    //// Load Administrators
    private void BindList()
    {
        DataSet ds = ErrorLgBLL.Load_Log();

        if (ds.Tables[0].Rows.Count > 0)
        {
            Pagination_Process.Process_Pagination(MyList, rptPages, lnk_Prev, lnk_Next, 20, this.PageNumber, ds.Tables[0].DefaultView);
            //Process_Pagination(ds);
            pnl_main.Visible     = true;
            pnl_norecord.Visible = false;
        }
        else
        {
            pnl_main.Visible     = false;
            pnl_norecord.Visible = true;
        }
    }
Пример #4
0
    private void BindList()
    {
        string search = "all";

        if (txt_search.Text != "")
        {
            search = txt_search.Text;
        }
        this.TotalRecords = members.Count_Members(search, drp_gender.SelectedValue, "0", drp_countries.SelectedValue, drp_isenabled.SelectedValue, drp_type.SelectedValue, Convert.ToInt32(drp_filter.SelectedValue));
        // no record found
        if (this.TotalRecords == 0)
        {
            pnl_main.Visible     = false;
            pnl_norecord.Visible = true;
            lbl_records.Text     = "0 records found";
            return;
        }

        List <Member_Struct> _lst = members.Load_Members(search, drp_gender.SelectedValue, "0", drp_countries.SelectedValue, drp_isenabled.SelectedValue, drp_type.SelectedValue, Convert.ToInt32(drp_filter.SelectedValue), ViewState["order"].ToString(), ViewState["direction"].ToString(), this.PageNumber, this.PageSize);

        if (_lst.Count > 0)
        {
            if (this.TotalRecords > 0)
            {
                lbl_records.Text = _lst.Count + " records found";
            }
            else
            {
                lbl_records.Text = _lst.Count + " record found";
            }

            Pagination_Process.Process_Pagination(MyList, rptPages, lnk_Prev, lnk_Next, this.PageSize, this.PageNumber, _lst);
            pnl_main.Visible     = true;
            pnl_norecord.Visible = false;
        }
        else
        {
            pnl_main.Visible     = false;
            pnl_norecord.Visible = true;
            lbl_records.Text     = "0 records found";
        }
    }