private void BindGrid() { DesignationMasterDAL objclsDesignationMasterDAL = new DesignationMasterDAL(); string strEmpName = string.IsNullOrEmpty(txtDesigNm.Text.Trim()) ? "" : (txtDesigNm.Text.Trim()); var objEmpMaster = objclsDesignationMasterDAL.Select(strEmpName); objclsDesignationMasterDAL = null; if (objEmpMaster != null && objEmpMaster.Count > 0) { grdMain.DataSource = objEmpMaster; grdMain.DataBind(); lblTotalRecord.Text = "T. Record (s): " + objEmpMaster.Count; imgBtnExcel.Visible = true; int startRowOnPage = (grdMain.PageIndex * grdMain.PageSize) + 1; int lastRowOnPage = startRowOnPage + grdMain.Rows.Count - 1; lblcontant.Text = "Showing " + startRowOnPage.ToString() + " - " + lastRowOnPage.ToString() + " of " + objEmpMaster.Count.ToString(); lblcontant.Visible = true; divpaging.Visible = true; } else { grdMain.DataSource = null; grdMain.DataBind(); lblTotalRecord.Text = "T. Record (s): 0 "; imgBtnExcel.Visible = false; divpaging.Visible = false; lblcontant.Visible = false; } }
private void BindDesignation() { DesignationMasterDAL designation = new DesignationMasterDAL(); var lst = designation.Select(); designation = null; ddlDesig.DataSource = lst; ddlDesig.DataTextField = "Desig_Name"; ddlDesig.DataValueField = "Desig_Idno"; ddlDesig.DataBind(); }