protected void Page_Load(object sender, EventArgs e) { DataSet ds = new DataSet(); BE_ViewSelected beview = new BE_ViewSelected(); BA_ContractEmp bacontractemp = new BA_ContractEmp(); DA_ContarctEmployee dacont = new DA_ContarctEmployee(); string s = Request.QueryString["id"].ToString(); beview.JobID = Convert.ToInt32(s); ds = bacontractemp.getViewContractEmp(beview); dlContractEmp.DataSource = ds.Tables[0]; dlContractEmp.DataBind(); }
protected void FillGrid() { DataSet ds = new DataSet(); BA_ContractEmp bacontract = new BA_ContractEmp(); BE_ViewSelected beviewselected = new BE_ViewSelected(); beviewselected.Company = Session["PSEName"].ToString(); ds = bacontract.getContractEmp(beviewselected); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { pnlMain.Visible = true; pnlSub.Visible = false; _PageDataSource.DataSource = ds.Tables[0].DefaultView; _PageDataSource.AllowPaging = true; _PageDataSource.PageSize = PageSize; _PageDataSource.CurrentPageIndex = CurrentPage; ViewState["TotalPages"] = _PageDataSource.PageCount; this.lblPageInfo.Text = "Page " + (CurrentPage + 1) + " of " + _PageDataSource.PageCount; this.lbtnPrevious.Enabled = !_PageDataSource.IsFirstPage; this.lbtnNext.Enabled = !_PageDataSource.IsLastPage; this.lbtnFirst.Enabled = !_PageDataSource.IsFirstPage; dljobdet.DataSource = _PageDataSource; dljobdet.DataBind(); this.doPaging(); } else { pnlMain.Visible = false; pnlSub.Visible = true; } } else { pnlMain.Visible = false; pnlSub.Visible = true; } }