예제 #1
0
        public MainWindowVM(DateTime unclosedDate, ITenantDBsDir tenantDBsDir, bool clickRefresh = true) : base(tenantDBsDir)
        {
            Date      = unclosedDate;
            CanReview = AppArgs.CanPostAndClose(false);
            CanEncode = AppArgs.CanEncodeCollections(false);
            if (!IsPrivilegedUser())
            {
                return;
            }

            ColxnsDB = CheckIfDbExists(Date);
            if (ColxnsDB == null)
            {
                return;
            }

            SectionTabs     = new TabsListVM(this);
            CashierColxns   = new CashierColxnsVM(this);
            OtherColxns     = new OtherColxnsVM(this);
            BankDeposits    = new BankDepositsVM(this);
            ApprovalAwaiter = new ApprovalRequesterVM(this);
            PostAndClose    = new PostAndCloseVM(this);
            NextDayOpener   = new NextDayOpenerVM(this);

            if (clickRefresh)
            {
                ClickRefresh();
            }
            SetCaption("");
        }