private void AddError(Investor investor, string v) { CashFlowErrors error = new CashFlowErrors() { InvestorId = investor.Id, ErrorText = v, ObjectName = investor.IName.FullName }; Errors.Add(error); }
private void AddError(PeFund fund, string v) { CashFlowErrors error = new CashFlowErrors() { PeFundId = fund.Id, ErrorText = v, ObjectName = fund.FundShortName }; Errors.Add(error); }
private void CheckStandingData() { if (cashFlowInformation.Fund.IsHqTrustFund) { if (cashFlowInformation.Fund.InitiatorId == 0) { ErrorCounter++; AddError(cashFlowInformation.Fund, "Es ist kein Initiator erfasst!"); } else { if (string.IsNullOrEmpty(cashFlowInformation.Fund.Initiator.FooterLine1)) { ErrorCounter++; AddError(cashFlowInformation.Fund, "Für den Initiator sind keine Fusszeilen erfasst!"); } } } foreach (CashFlowDetail detail in cashFlowInformation.InvestorDetails) { if (string.IsNullOrEmpty(detail.Reference)) { errorCounter++; AddError(detail.Investor, "Weder beim Investor noch beim Commitment wurde eine Referenz angegeben."); } if (detail.BankAccount == null) { errorCounter++; AddError(detail.Investor, "Eine Bankverbindung fehlt"); } if (detail.Investor.SendEmail == true) { if (detail.Investor.EMailAccounts.Count == 0 && string.IsNullOrEmpty(detail.Investor.IName.EmailAddress)) { errorCounter++; AddError(detail.Investor, "Für diesen Investor sollen E-Mails verschickt werden. Es sind keine E-Mail-Adressen angegeben"); } } } if (Errors.Count == 0) { CashFlowErrors error = new CashFlowErrors() { InvestorId = 0, PeFundId = 0, ErrorText = "Es wurden keine Fehler festgestellt", ObjectName = string.Empty }; Errors.Add(error); CanGotoNextStep = true; CashFlowInformation.InvestorsChecked = true; } else { CashFlowErrors error = new CashFlowErrors() { InvestorId = 0, PeFundId = 0, ObjectName = "Zusammenfassung:", ErrorText = $"Es wurden {ErrorCounter.ToString()} Fehler entdeckt." }; Errors.Insert(0, error); if (Properties.Settings.Default.Anwender == "BLL") { CanGotoNextStep = true; CashFlowInformation.InvestorsChecked = true; } } }