Esempio n. 1
0
        public override void OnNavigatedTo(NavigationContext navigationContext)
        {
            Investor = navigationContext.Parameters["Investor"] as Investor;
            if (Investor == null)
            {
                TabTitle            = "unbekannt";
                Investor            = new Investor();
                EMailAccounts       = new ObservableCollection <EMailAccount>(Investor.EMailAccounts);
                TaxInformation      = new ObservableCollection <TaxInformation>(Investor.TaxInformations);
                InvestorToDo        = new ObservableCollection <InvestorToDo>();
                Investor.CurrencyId = ComboboxLists.GetEuroCurrency().Id;
                Investor.Currency   = ComboboxLists.GetEuroCurrency();
            }
            else
            {
                TabTitle = Investor.InvestorHqTrustAccount;
                if (string.IsNullOrEmpty(TabTitle))
                {
                    TabTitle = Investor.IName.LastName;
                }

                Investor       = investorAccess.GetInvestorDetailsById(Investor.Id);
                EMailAccounts  = new ObservableCollection <EMailAccount>(Investor.EMailAccounts);
                TaxInformation = new ObservableCollection <TaxInformation>(Investor.TaxInformations);
                InvestorToDo   = new ObservableCollection <InvestorToDo>(investorAccess.GetToDosForInvestor(Investor.Id));
                if (Investor.Commitments.Count == 0)
                {
                    CanDeleteInvestor = true;
                }

                CreatePreviewAddress();
            }
            accountListToken = eventAggregator.GetEvent <AccountCollectionEvent>().Subscribe(OnAccountListChanged);
        }
        public override void OnNavigatedTo(NavigationContext navigationContext)
        {
            SelectedFund = navigationContext.Parameters["Fund"] as PeFund;
            // remove fund from List of feeder funds
            if (SelectedFund.Id != 0 && FeederFunds != null)
            {
                FeederFunds.Remove(SelectedFund);
            }
            if (string.IsNullOrEmpty(SelectedFund.FundHqTrustNumber))
            {
                TabTitle = SelectedFund.FundShortName;
            }
            else
            {
                TabTitle = SelectedFund.FundHqTrustNumber;
            }
            RaisePropertyChanged("SelectedPeFund");

            // check whether cashFlowInformation exists
            DirectoryHelper.CheckDirectory($"TextFiles");
            FileInfo textFileInfo = DirectoryHelper.GetTextFileName(SelectedFund.Id);

            if (textFileInfo.Exists)
            {
                CashFlowInformationExists = true;
            }

            if (SelectedFund.CurrencyId == null)
            {
                SelectedFund.CurrencyId = ComboboxLists.GetEuroCurrency().Id;
            }
            if (SelectedFund.Initiator != null)
            {
                if (!string.IsNullOrEmpty(SelectedFund.Initiator.InitiatorAddress.Street))
                {
                    HasHeadQuarter = true;
                }
            }

            // Fund can be removed if the fund has no commitments

            if (!PefundAccess.FundHasCommitments(SelectedFund))
            {
                CanRemoveFund = true;
            }
            // CanShowPsPlusCashFlows = (PefundAccess.BeteiligungsNummerExistsMoreThanOnce(SelectedFund));
        }
 private void OnInitiatorUpdated(string obj)
 {
     Initiators = (List <Initiator>)ComboboxLists.GetInitiators();
     RaisePropertyChanged("Initiators");
     eventAggregator.GetEvent <InitiatorUpdatedEvent>().Unsubscribe(initiatorToken);
 }