Esempio n. 1
0
        public async Task Fill(LeaseBalAdjustmentsVM windowVM)
        {
            var lse      = windowVM.Lease;
            var main     = windowVM.Main;
            var url      = BalanceAdjConverter1.VIEWS_ID;
            var conv     = new BalanceAdjConverter1(lse, main);
            var dynamics = await conv.GetViewsList(url);

            var byfAdjs = dynamics.Select(_ => conv.CastToRNT(_));
            var rows    = new List <LeaseBalAdjRow>();

            foreach (BalanceAdjustmentDTO byf in byfAdjs)
            {
                if (conv._memoTypes[byf.Id] == 1)
                {
                    continue;                               //cashier colxn?
                }
                if (byf.Remarks.Contains("Daily Rights Surcharge Memo"))
                {
                    continue;
                }
                var row = new LeaseBalAdjRow(byf, conv, main.AppArgs);
                rows.Add(row);
            }
            UIThread.Run(() => this.SetItems
                             (rows.OrderBy(_ => _.Date)));
        }
Esempio n. 2
0
        private static void ProcessLeases <T>(MainWindowVM2 main, ISimpleRepo <T> repo)
            where T : LeaseDTO
        {
            foreach (var lse in repo.GetAll())
            {
                main.StartBeingBusy($"Verifying memos for [{lse.Id}] “{lse}”...");

                var win = new LeaseBalAdjustmentsVM(lse, main);
                win.Show <LeaseBalAjsWindow>(false, true);

                //foreach (BalanceAdjustmentDTO byf in byfAdjs)
                //    VerifyLeaseMemo(byf, conv, main.AppArgs);
            }
        }
Esempio n. 3
0
        public async Task Import(LeaseBalAdjustmentsVM windowVM)
        {
            windowVM.StartBeingBusy("Importing ...");
            await Task.Run(() =>
            {
                foreach (var row in this)
                {
                    row.UpsertDTO();
                }

                var lse  = windowVM.Lease;
                var bals = windowVM.AppArgs.Balances.GetRepo(lse);
                var day1 = bals.Earliest().GetBillDate();

                windowVM.StartBeingBusy("Recomputing ...");
                bals.RecomputeFrom(day1);
            });

            windowVM.StopBeingBusy();
            windowVM.ClickRefresh();
        }