コード例 #1
0
        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();
        }
コード例 #2
0
 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());
 }