private void SelectOtherBudget()
        {
            this.dialogCorrelationId = Guid.NewGuid();
            var popUpRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.Budget, new BudgetSelectionViewModel(Budgets), ShellDialogType.Ok)
            {
                CorrelationId = this.dialogCorrelationId
            };

            MessengerInstance.Send(popUpRequest);
        }
        public void PromptUserForDates()
        {
            this.dialogCorrelationId = Guid.NewGuid();
            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.Dashboard, this, ShellDialogType.OkCancel)
            {
                CorrelationId = this.dialogCorrelationId,
                Title         = "Global Date Filter"
            };

            MessengerInstance.Send(dialogRequest);
        }
        private void ShowDialogCommon(bool isNew)
        {
            IsReadOnly = !isNew;
            this.dialogCorrelationId = Guid.NewGuid();
            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.LedgerBook, this, IsReadOnly ? ShellDialogType.Ok : ShellDialogType.OkCancel)
            {
                CorrelationId = this.dialogCorrelationId,
                Title         = Title
            };

            MessengerInstance.Send(dialogRequest);
        }
        public void ShowDialog(BudgetAnalyserFeature source, Guid?correlationId = null)
        {
            this.dialogCorrelationId = correlationId ?? Guid.NewGuid();

            var dialogRequest = new ShellDialogRequestMessage(source, this, ShellDialogType.OkCancel)
            {
                CorrelationId = this.dialogCorrelationId,
                Title         = "Create new surprise regular payment monitor",
                HelpAvailable = true
            };

            MessengerInstance.Send(dialogRequest);
        }
Esempio n. 5
0
        public void ShowDialog(DateTime defaultEffectiveDate)
        {
            this.dialogCorrelationId = Guid.NewGuid();
            EffectiveFrom            = defaultEffectiveDate;

            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.Budget, this, ShellDialogType.SaveCancel)
            {
                CorrelationId = this.dialogCorrelationId,
                Title         = "Create new Budget based on current",
                HelpAvailable = true
            };

            MessengerInstance.Send(dialogRequest);
        }
        public void ShowDialog(IEnumerable <MatchingRule> allRules)
        {
            SimilarRules = allRules.Select(r => new SimilarMatchedRule(this.bucketRepo, r)).ToList();
            UpdateSimilarRules();

            this.shellDialogCorrelationId = Guid.NewGuid();
            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.Transactions, this, ShellDialogType.SaveCancel)
            {
                CorrelationId = this.shellDialogCorrelationId,
                Title         = Title
            };

            MessengerInstance.Send(dialogRequest);
        }
Esempio n. 7
0
        public void ShowDialog(BudgetAnalyserFeature source, string title, Guid?correlationId = null, bool showBankAccountSelector = false)
        {
            this.dialogCorrelationId = correlationId ?? Guid.NewGuid();

            ShowBankAccount = showBankAccountSelector;

            var dialogRequest = new ShellDialogRequestMessage(source, this, ShellDialogType.OkCancel)
            {
                CorrelationId = this.dialogCorrelationId,
                Title         = title
            };

            MessengerInstance.Send(dialogRequest);
        }
Esempio n. 8
0
        public void Show(LedgerEntryLine line, bool isNew)
        {
            LedgerEntryLine          = line;
            Remarks                  = LedgerEntryLine.Remarks;
            IsReadOnly               = !isNew;
            this.dialogCorrelationId = Guid.NewGuid();
            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.LedgerBook, this, ShellDialogType.Ok)
            {
                Title         = "Ledger Entry Remarks",
                CorrelationId = this.dialogCorrelationId
            };

            MessengerInstance.Send(dialogRequest);
        }
Esempio n. 9
0
        public void ShowDialog(IEnumerable <LedgerBucket> ledgerBuckets)
        {
            Reset();
            TransferFundsDto         = new TransferFundsCommand();
            LedgerBuckets            = ledgerBuckets.ToList();
            this.dialogCorrelationId = Guid.NewGuid();
            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.LedgerBook, this, ShellDialogType.SaveCancel)
            {
                CorrelationId = this.dialogCorrelationId,
                Title         = "Transfer Funds"
            };

            MessengerInstance.Send(dialogRequest);
        }
Esempio n. 10
0
        public void ShowDialog(Transaction originalTransaction, Guid correlationId)
        {
            BudgetBuckets            = this.bucketRepo.Buckets;
            this.dialogCorrelationId = correlationId;
            OriginalTransaction      = originalTransaction;
            SplinterAmount1          = OriginalTransaction.Amount;
            SplinterAmount2          = 0M;
            SplinterBucket2          = SplinterBucket1 = OriginalTransaction.BudgetBucket;

            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.Transactions, this, ShellDialogType.SaveCancel)
            {
                CorrelationId = correlationId,
                Title         = "Split Transaction"
            };

            MessengerInstance.Send(dialogRequest);
        }
        private void ShowDialogCommon(string title)
        {
            Canceled = false;
            List <Account> accountsToShow = this.accountTypeRepository.ListCurrentlyUsedAccountTypes().ToList();

            BankAccounts             = accountsToShow.OrderBy(a => a.Name);
            SelectedBankAccount      = null;
            this.dialogCorrelationId = Guid.NewGuid();
            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.LedgerBook, this, ShellDialogType.OkCancel)
            {
                CorrelationId = this.dialogCorrelationId,
                Title         = title,
                HelpAvailable = CreateMode
            };

            MessengerInstance.Send(dialogRequest);
        }
        public void ShowDialog([NotNull] LedgerEntryLine ledgerLine)
        {
            if (ledgerLine == null)
            {
                throw new ArgumentNullException(nameof(ledgerLine));
            }

            SurplusBalances      = new ObservableCollection <BankBalance>(ledgerLine.SurplusBalances);
            this.ledgerEntryLine = ledgerLine;

            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.LedgerBook, this, ShellDialogType.Ok)
            {
                CorrelationId = Guid.NewGuid(),
                Title         = "Surplus Balances in all Accounts"
            };

            MessengerInstance.Send(dialogRequest);
        }
Esempio n. 13
0
        private Task RequestUserInputCommomPreparation()
        {
            FileName                    = null;
            ExistingAccountNames        = this.accountTypeRepository.ListCurrentlyUsedAccountTypes().ToList();
            SelectedExistingAccountName = ExistingAccountNames.First(a => a.IsSalaryAccount);

            this.dialogCorrelationId = Guid.NewGuid();
            var popRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.Transactions, this, ShellDialogType.OkCancel)
            {
                CorrelationId = this.dialogCorrelationId,
                Title         = Title
            };

            this.fileSelectionTask?.Dispose();

            this.fileSelectionTask = new Task(() => { });
            MessengerInstance.Send(popRequest);
            return(this.fileSelectionTask);
        }
        public void ShowDialog([NotNull] Engine.Ledger.LedgerBook parentLedgerBook, [NotNull] LedgerBucket ledgerBucket, [NotNull] BudgetModel budgetModel)
        {
            if (parentLedgerBook == null)
            {
                throw new ArgumentNullException(nameof(parentLedgerBook));
            }

            if (ledgerBucket == null)
            {
                throw new ArgumentNullException(nameof(ledgerBucket));
            }

            if (budgetModel == null)
            {
                throw new ArgumentNullException(nameof(budgetModel));
            }

            if (LedgerBucketHistoryAnalysis == null)
            {
                LedgerBucketHistoryAnalysis = CreateBucketHistoryAnalyser();
            }
            LedgerBucketHistoryAnalysis.Analyse(ledgerBucket, parentLedgerBook);
            this.ledger         = ledgerBucket;
            BankAccounts        = new ObservableCollection <Account>(this.accountRepo.ListCurrentlyUsedAccountTypes());
            BucketBeingTracked  = ledgerBucket.BudgetBucket;
            StoredInAccount     = ledgerBucket.StoredInAccount;
            MonthlyBudgetAmount = budgetModel.Expenses.Single(e => e.Bucket == BucketBeingTracked).Amount;
            this.correlationId  = Guid.NewGuid();

            var dialogRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.LedgerBook, this, ShellDialogType.OkCancel)
            {
                CorrelationId = this.correlationId,
                Title         = "Ledger - " + BucketBeingTracked,
                HelpAvailable = true
            };

            MessengerInstance.Send(dialogRequest);
        }
Esempio n. 15
0
        private void OnDialogRequested(ShellDialogRequestMessage message)
        {
            ShellDialogController dialogController;

            switch (message.Location)
            {
            case BudgetAnalyserFeature.LedgerBook:
                dialogController = LedgerBookDialog;
                break;

            case BudgetAnalyserFeature.Dashboard:
                dialogController = DashboardDialog;
                break;

            case BudgetAnalyserFeature.Budget:
                dialogController = BudgetDialog;
                break;

            case BudgetAnalyserFeature.Transactions:
                dialogController = TransactionsDialog;
                break;

            case BudgetAnalyserFeature.Reports:
                dialogController = ReportsDialog;
                break;

            default:
                throw new NotSupportedException("The requested shell dialog location is not supported: " + message.Location);
            }

            dialogController.Title             = message.Title;
            dialogController.Content           = message.Content;
            dialogController.DialogType        = message.DialogType;
            dialogController.CorrelationId     = message.CorrelationId;
            dialogController.HelpButtonVisible = message.HelpAvailable;
        }
Esempio n. 16
0
        private void OnDetailsCommandExecute()
        {
            var popUpRequest = new ShellDialogRequestMessage(BudgetAnalyserFeature.Budget, CurrentBudget, ShellDialogType.Ok);

            MessengerInstance.Send(popUpRequest);
        }