private void BindGridViewType(string search) { FiltersModel fm = Session["FiltersModel"] as FiltersModel; List <EmpType> _View = new List <EmpType>(); QueryBuilder qb = new QueryBuilder(); DataTable dt = qb.GetValuesfromDB("select * from EmpType "); _View = dt.ToList <EmpType>(); GridViewType.DataSource = _View.Where(aa => aa.TypeName.ToUpper().Contains(search.ToUpper())).ToList(); GridViewType.DataBind(); }
private void BindGridViewType(string search) { FiltersModel fm = Session["FiltersModel"] as FiltersModel; ViewUserEmp LoggedInUser = HttpContext.Current.Session["LoggedUser"] as ViewUserEmp; List <HR_EmpType> _View = new List <HR_EmpType>(); QueryBuilder qb = new QueryBuilder(); string query = qb.QueryForEmployeeTypeReport(LoggedInUser); DataTable dt = new DataTable(); if (query != "where") { dt = qb.GetValuesfromDB("select * from HR_EmpType " + query); } _View = dt.ToList <HR_EmpType>(); GridViewType.DataSource = _View.Where(aa => aa.TypeName.ToUpper().Contains(search.ToUpper())).OrderBy(aa => aa.TypeName).ToList(); GridViewType.DataBind(); }
private void BindGridViewType(string search) { FiltersModel fm = Session["FiltersModel"] as FiltersModel; List <ViewEmpType> _View = new List <ViewEmpType>(); List <ViewEmpType> _TempView = new List <ViewEmpType>(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.QueryForCompanyViewForLinq(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from ViewEmpType where " + query); _View = dt.ToList <ViewEmpType>().AsQueryable().SortBy("TypeName").ToList(); if (fm.CompanyFilter.Count > 0) { foreach (var comp in fm.CompanyFilter) { short _compID = Convert.ToInt16(comp.ID); _TempView.AddRange(_View.Where(aa => aa.CompanyID == _compID).ToList()); } _View = _TempView.ToList(); } GridViewType.DataSource = _View.Where(aa => aa.TypeName.ToUpper().Contains(search.ToUpper())).ToList(); GridViewType.DataBind(); }