protected void btnSearch_Click(object sender, EventArgs e) { try { ATTEmployeeDetailSearch objSearch = new ATTEmployeeDetailSearch(); if (this.ddlOrgName.SelectedIndex > 0) { objSearch.OrgID = int.Parse(this.ddlOrgName.SelectedValue); } if (this.txtFName.Text.Trim() != "") { objSearch.FirstName = this.txtFName.Text; } if (this.txtMName.Text.Trim() != "") { objSearch.MiddleName = this.txtMName.Text; } if (this.txtSName.Text.Trim() != "") { objSearch.SurName = this.txtSName.Text; } if (this.ddlPost.SelectedIndex > 0) { objSearch.PostID = int.Parse(this.ddlPost.SelectedValue); } if (this.ddlLevel.SelectedIndex > 0) { objSearch.LevelID = int.Parse(this.ddlLevel.SelectedValue); } Session["propertyReportSearch"] = BLLEmployeeDetailSearch.PropertyReportSearchList(objSearch); List <ATTEmployeeDetailSearch> lst = (List <ATTEmployeeDetailSearch>)Session["propertyReportSearch"]; if (lst.Count > 0) { string count = ""; count = lst.Count.ToString().Replace("0", "०"); count = count.ToString().Replace("1", "१"); count = count.ToString().Replace("2", "२"); count = count.ToString().Replace("3", "३"); count = count.ToString().Replace("4", "४"); count = count.ToString().Replace("5", "५"); count = count.ToString().Replace("6", "६"); count = count.ToString().Replace("7", "७"); count = count.ToString().Replace("8", "८"); count = count.ToString().Replace("9", "९"); lblSearchResult.Text = count + " वटा रेकर्ड भेटिए ... "; this.grdEmployeeSearch.DataSource = Session["propertyReportSearch"]; this.grdEmployeeSearch.DataBind(); } else { lblSearchResult.Text = "कुनै पनि रेकर्ड भेटिएनन् ... "; this.grdEmployeeSearch.DataSource = ""; this.grdEmployeeSearch.DataBind(); this.btnGenerateRpt.Visible = false; } } catch (Exception ex) { throw(ex); } }
protected void btnSearch_Click(object sender, EventArgs e) { ATTEmployeeDetailSearch search = new ATTEmployeeDetailSearch(); if (this.ddlOrganization.SelectedIndex > 0) { search.OrgID = int.Parse(this.ddlOrganization.SelectedValue); } if (this.txtFName.Text.Trim() != "") { search.FirstName = this.txtFName.Text; } if (this.txtMName.Text.Trim() != "") { search.MiddleName = this.txtMName.Text; } if (this.txtSName.Text.Trim() != "") { search.SurName = this.txtSName.Text; } if (this.ddlSewa.SelectedIndex > 0) { search.SewaID = int.Parse(this.ddlSewa.SelectedValue); } if (this.ddlSamuha.SelectedIndex > 0) { search.SamuhaID = int.Parse(this.ddlSamuha.SelectedValue); } if (this.ddlUpaSamuha.SelectedIndex > 0) { search.UpaSamuhaID = int.Parse(this.ddlUpaSamuha.SelectedValue); } if (this.ddlPost.SelectedIndex > 0) { search.PostID = int.Parse(this.ddlPost.SelectedValue); } if (this.ddlLevel.SelectedIndex > 0) { search.LevelID = int.Parse(this.ddlLevel.SelectedValue); } if (this.ddlPostingType.SelectedIndex > 0) { search.PostingTypeID = int.Parse(this.ddlPostingType.SelectedValue); } if (this.ddlSex.SelectedIndex > 0) { search.Gender = this.ddlSex.SelectedValue; } if (this.ddlDistrict.SelectedIndex > 0) { search.DistrictID = int.Parse(this.ddlDistrict.SelectedValue); } if (this.txtTraining.Text.Trim() != "") { search.Training = this.txtTraining.Text; } if (this.txtRetirementDate.Text.Trim() != "") { search.RetirementDate = this.txtRetirementDate.Text; search.RetirementDateOperator = this.ddlROperator.SelectedItem.Text; search.RetirementYear = 20; } search.QualificationList = this.GetCheckedValueList(this.lstQualification); search.VisitList = this.GetCheckedValueList(this.lstVisit); //this.grdEmployee.DataSource = BLLEmployeeDetailSearch.DetailSearchEmployee(search); Session["EmployeeDetailSearch"] = BLLEmployeeDetailSearch.DetailSearchEmployeeList(search); this.grdEmployee.DataSource = Session["EmployeeDetailSearch"]; this.grdEmployee.DataBind(); //foreach (GridViewRow row in this.grdEmployee.Rows) //{ // if (row.Cells[16].Text == "hide" && row.Cells[17].Text == "hide" && row.Cells[18].Text == "hide") // for (int i = 0; i <= 21; i++) // { // row.Cells[i].Visible = false; // } //} this.LoadImageX.Width = new Unit(0); this.LoadImageX.Height = new Unit(0); }