public void Refresh() { _filterString = ""; _filterStringSN = ""; RaisePropertyChanged(() => FilterString); RaisePropertyChanged(() => FilterStringSN); RaisePropertyChanged(() => NonDistributorVisibility); PosCustomersBase = DaoController.Current.GetCustomers() .Where( i => string.IsNullOrEmpty(_filterString) || (!string.IsNullOrEmpty(i.Name) && i.Name.ToLower().Contains(_filterString.ToLower()))).ToList(); if (CustomerButtonType == CustomerButtonTypes.Today) { var c = ((int)DateTime.Today.DayOfWeek).ToString(); PosCustomersBase = PosCustomersBase.Where(i => i.VisitWeekDays != null && i.VisitWeekDays.Contains(c)).ToList(); } PosCustomers = FilterList(); RaisePropertyChanged(() => PosCustomers); // InitCharts(); InitChartsTable(); InitLocations(); }
public List <Customer> FilterList() { return(PosCustomersBase.Where( i => (string.IsNullOrEmpty(_filterString) || (!string.IsNullOrEmpty(i.Name) && i.Name.ToLower().Contains(_filterString.ToLower()))) && (string.IsNullOrEmpty(_filterStringSN) || (!string.IsNullOrEmpty(i.VATRegistrationNo_) && i.VATRegistrationNo_.ToLower().Contains(_filterStringSN.ToLower())))).ToList()); }