using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class UserControl_onLine : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataSet ds = BLL.BLLemployee.OnLine();
        if (ds.Tables[0].Rows.Count != 0)
        {
            pagebind();
            this.Label4.Visible = false;
        }
        else
        {
            this.Label4.Visible = true;
        }
        
    }
    public void pagebind()
    {
        PagedDataSource pds = new PagedDataSource();
        DataSet ds = BLL.BLLemployee.OnLine();
        pds.DataSource = ds.Tables[0].DefaultView;
        pds.AllowPaging = true;
        AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize = AspNetPager1.PageSize;
        this.DataList1.DataSource = pds;
        this.DataList1.DataBind();
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        pagebind();
    }
}
