Ejemplo n.º 1
0
        public Filter(nisan nisan)
        {
            this.target = nisan;
            this.IsPending = true;
            this.HasDateRange = false;

            // adding pending option
            this.Rules = new ObservableCollection<FilterRule>();
            FilterRule pending = new FilterRule("Pending", true);
            pending.Parent = this;
            this.Rules.Add(pending);

            // adding all customer list
            foreach (string customer in target.GetSoldToList())
            {
                FilterRule child = new FilterRule(customer);
                child.Parent = this;
                this.Rules.Add(child);
            }

            // add date selection
            FilterDateRule dateRule = new FilterDateRule();
            DateTime from = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
            dateRule.From = from;
            dateRule.Parent = this;
            this.Rules.Add(dateRule);
        }
Ejemplo n.º 2
0
 private void SetAllFalse(FilterRule rule, string except)
 {
     if (rule.Name != except) rule.IsChecked = false;
     foreach (FilterRule child in rule.Children)
         SetAllFalse(child, except);
 }