protected void GetApprovedUsers() { DataTable dt = null; dt = DataProxy.GetApprovedUsers(); DataView dv = dt.DefaultView; //if (dv != null) // dv.Sort = "Approved ASC"; grdApproveUser.DataSource = dt; grdApproveUser.DataBind(); grdApproveUser.Visible = true; Session["dvUserRequests"] = dt.DefaultView; btnPrint.Visible = true; btnExport.Visible = true; lblReportTitle.Visible = true; }
protected void GetSearchResults() { DataTable dt = null; //bool bCountrySearch = false; //if (ddlCountries.SelectedIndex > 0) // bCountrySearch = true; int intCountryID = 0; string strCountry = ""; if (ddlCountries.SelectedValue != "") { intCountryID = Convert.ToInt32(ddlCountries.SelectedValue); strCountry = ddlCountries.SelectedItem.Text; } dt = DataProxy.GetApprovedUsers(); DataView dv = dt.DefaultView; dv.RowFilter = "1=1 "; if (intCountryID > 0) { dv.RowFilter += "AND CountryExpertise LIKE '%" + strCountry + "%'"; } if (ddlRoles.SelectedIndex > 0) { dv.RowFilter += "AND UserType = '" + ddlRoles.SelectedValue + "'"; } grdApproveUser.DataSource = dv; grdApproveUser.DataBind(); grdApproveUser.Visible = true; Session["dvUserRequests"] = dt.DefaultView; btnPrint.Visible = true; btnExport.Visible = true; lblReportTitle.Visible = true; }