private int GetAllowanceApply(string EmployeeID) { TB_AllowanceApply mTB_AllowanceApply = new TB_AllowanceApply(); TB_AllowanceApplyBLL mTB_AllowanceApplyBLL = new TB_AllowanceApplyBLL(); Pager pager = new Pager(); DataTable dtSource = null; pager.CurrentPageIndex = 1; pager.srcOrder = " ID desc"; mTB_AllowanceApply.SiteID = (base.UserInfo == null ? base.SystemAdminInfo.SiteID : base.UserInfo.SiteID); mTB_AllowanceApply.EmployeeNo = EmployeeID; mTB_AllowanceApply.Name = ""; mTB_AllowanceApply.CardNo = ""; dtSource = mTB_AllowanceApplyBLL.GetTable(mTB_AllowanceApply, ref pager); return(Convert.ToInt32(dtSource.Rows[0]["ID"])); }
private void Bind(int intCurrentIndex) { TB_AllowanceApply mTB_AllowanceApply = new TB_AllowanceApply(); TB_AllowanceApplyBLL mTB_AllowanceApplyBLL = new TB_AllowanceApplyBLL(); Pager pager = new Pager(); pager.CurrentPageIndex = intCurrentIndex; pager.srcOrder = " ID desc"; mTB_AllowanceApply.Name = ""; mTB_AllowanceApply.SiteID = (base.UserInfo == null ? base.SystemAdminInfo.SiteID : base.UserInfo.SiteID); mTB_AllowanceApply.CardNo = this.txtScanCardNO.Text.Trim(); mTB_AllowanceApply.EmployeeNo = this.txtWorkDayNo.Text.Trim(); mTB_AllowanceApply.BU = this.txtBu.Text.Trim(); DateTime dtCheckOut = DateTime.Now; if (DateTime.TryParse(this.txtHireDate.Text.Trim(), out dtCheckOut)) { mTB_AllowanceApply.Hire_Date = dtCheckOut; } dtCheckOut = DateTime.Now; if (DateTime.TryParse(this.txtEffectiveDate.Text.Trim(), out dtCheckOut)) { mTB_AllowanceApply.Effective_Date = dtCheckOut; } if (ddlEmpType.SelectedIndex > 0) { mTB_AllowanceApply.EmployeeTypeName = ddlEmpType.SelectedItem.Text; } DataTable dt = mTB_AllowanceApplyBLL.GetTable(mTB_AllowanceApply, ref pager); GridView1.DataSource = dt; GridView1.DataBind(); this.Pager1.ItemCount = pager.TotalRecord; this.Pager1.PageCount = pager.TotalPage; this.Pager1.CurrentIndex = pager.CurrentPageIndex; this.Pager1.PageSize = pager.PageSize; }