Exemple #1
0
 protected override void OnInitialize()
 {
     base.OnInitialize();
     DbReloadToken
     .Merge(Begin.Select(x => (object)x))
     .Merge(End.Select(x => (object)x))
     .Merge(IsNotPosted.Changed())
     .Merge(IsPosted.Changed())
     .Subscribe(_ => Update(), CloseCancellation.Token);
 }
Exemple #2
0
 protected override void OnInitialize()
 {
     base.OnInitialize();
     DbReloadToken
     .Merge(Begin.Select(x => (object)x))
     .Merge(End.Select(x => (object)x))
     .SelectMany(_ => RxQuery(s => s.Query <ReassessmentDoc>()
                              .Where(x => x.Date > Begin.Value && x.Date < End.Value.AddDays(1))
                              .Fetch(x => x.Address)
                              .OrderByDescending(x => x.Date).ToList()))
     .Subscribe(Items);
 }
        protected override void OnInitialize()
        {
            base.OnInitialize();

            DbReloadToken
            .Merge(Begin.Changed())
            .Merge(End.Changed())
            .Merge(IsNotOverdue.Changed())
            .Merge(IsOverdue.Changed())
            .SelectMany(_ => RxQuery(LoadItems))
            .Subscribe(Items);
        }
Exemple #4
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            DbReloadToken
            .Merge(DateBegin.Changed())
            .Merge(DateEnd.Changed())
            .Merge(SupplierCostBegin.Changed())
            .Merge(SupplierCostEnd.Changed())
            .Merge(RetailCostBegin.Changed())
            .Merge(RetailCostEnd.Changed())
            .SelectMany(_ => RxQuery(LoadItems))
            .Subscribe(Items);
        }
        protected override void OnInitialize()
        {
            base.OnInitialize();

            DbReloadToken
            .Merge(Begin.Select(x => (object)x))
            .Merge(End.Select(x => (object)x))
            .SelectMany(_ => RxQuery(s => s.Query <Check>()
                                     .Where(x => x.Clerk != null && x.Date <= End.Value.AddDays(1) && x.Date >= Begin.Value)
                                     .Select(x => x.Clerk)
                                     .Distinct().ToList()
                                     .Select(x => new Selectable <string>(x)).ToList()))
            .Subscribe(Users);

            AddressSelector.Init();
            AddressSelector.FilterChanged.Cast <object>()
            .Merge(DbReloadToken)
            .Merge(Begin.Select(x => (object)x))
            .Merge(End.Select(x => (object)x))
            .Merge(Users.SelectMany(x => x?.Select(p => p.Changed()).Merge()
                                    ?? Observable.Empty <EventPattern <PropertyChangedEventArgs> >()))
            .Throttle(Consts.FilterUpdateTimeout, UiScheduler)
            .SelectMany(_ => RxQuery(s => {
                var query = s.Query <Check>()
                            .Where(c => c.Date <= End.Value.AddDays(1) && c.Date >= Begin.Value &&
                                   AddressSelector.GetActiveFilter().Contains(c.Address));

                var selectedUsers = Users.Value.Where(x => x.IsSelected).Select(x => x.Item).ToArray();
                if (selectedUsers.Length != Users.Value.Count && Users.Value.Count > 0)
                {
                    query = query.Where(x => selectedUsers.Contains(x.Clerk));
                }

                return(query.OrderByDescending(x => x.Date)
                       .Fetch(x => x.Address)
                       .ToList());
            }))
            .Subscribe(Items);
        }