private void BindGridViewShift(string search) { FiltersModel fm = Session["FiltersModel"] as FiltersModel; List <Shift> _View = new List <Shift>(); QueryBuilder qb = new QueryBuilder(); DataTable dt = qb.GetValuesfromDB("select * from Shift "); _View = dt.ToList <Shift>(); GridViewShift.DataSource = _View.Where(aa => aa.ShiftName.ToUpper().Contains(search.ToUpper())).ToList(); GridViewShift.DataBind(); }
private void BindGridView(string search) { User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); //string query = qb.QueryForCompanyView(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from Shift "); List <Shift> _View = dt.ToList <Shift>(); GridViewShift.DataSource = _View.Where(aa => aa.ShiftName.ToUpper().Contains(search.ToUpper())).ToList(); GridViewShift.DataBind(); }
private void BindGridView() { db = new webtimeclockEntities(); var shift = from s in db.shifts select s; if (shift.Count() > 0) { GridViewShift.DataSource = shift.ToList(); GridViewShift.DataBind(); } }
private void BindGridViewShift(string search) { FiltersModel fm = Session["FiltersModel"] as FiltersModel; List <Shift> _View = new List <Shift>(); List <Shift> _TempView = new List <Shift>(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.QueryForShiftForLinq(LoggedInUser); // DataTable dt = qb.GetValuesfromDB("select * from Shift " + query); _View = da.Shifts.Where(query).AsQueryable().OrderBy("ShiftName ASC").ToList(); if (fm.LocationFilter.Count > 0) { foreach (var loc in fm.LocationFilter) { short _locID = Convert.ToInt16(loc.ID); _TempView.AddRange(_View.Where(aa => aa.LocationID == _locID).ToList()); } _View = _TempView.ToList(); } GridViewShift.DataSource = _View.Where(aa => aa.ShiftName.ToUpper().Contains(search.ToUpper())).ToList(); GridViewShift.DataBind(); }