public void ThenTheCompletionPaymentsShouldNotBeIncludedInTheProjection()
 {
     Commitments.GroupBy(commitment => commitment.PlannedEndDate.AddMonths(1))
     .Select(g => new { Date = g.Key, CompletionAmount = g.Sum(commitment => commitment.CompletionAmount) })
     .ToList()
     .ForEach(completionAmount => Assert.IsFalse(AccountProjections.Any(ac => ac.Year == completionAmount.Date.Year && ac.Month == completionAmount.Date.Month && ac.LevyFundedCompletionPayments == completionAmount.CompletionAmount), $"Completion amount not found. Date: {completionAmount.Date:MMMM yyyy}, Completion Amount: {completionAmount}"));
 }
Ejemplo n.º 2
0
        private void OnConfirmDeleteCommitment(IConfirmation confirm)
        {
            if (!confirm.Confirmed)
            {
                return;
            }

            // delete Commitment

            try
            {
                investorAccess.DeleteInvestorCommitment(SelectedCommitment);
                eventAggregator.GetEvent <StatusBarEvent>().Publish($"Das Commitment für den Fonds {SelectedCommitment.PeFund.FundShortName} wurde gelöscht.");

                Commitments.Remove(SelectedCommitment);
            }
            catch (Exception ex)
            {
                NotificationRequest.Raise(new Notification
                {
                    Title   = ApplicationNames.NotificationTitle,
                    Content = $"Das Commitment für den Fonds {SelectedCommitment.PeFund.FundShortName} konnte nicht gelöscht werden. " + ex.Message
                });
            }
        }
Ejemplo n.º 3
0
        private void OnEditInvestorCommitmentResponse(EditInvestorCommitmentResponse response)
        {
            switch (response.ActionType)
            {
            case "OK":
            {
                if (response.editedCommitment.Id == 0)
                {
                    Commitments.Add(response.editedCommitment);
                    try
                    {
                        investorAccess.UpdateInvestorCommitments(response.editedCommitment);
                    }
                    catch (Exception ex)
                    {
                        NotificationRequest.Raise(new Notification
                            {
                                Title   = "Commitment ",
                                Content = $"Fehler beim Update der Datenbank: {ex.Message}"
                            });
                        return;
                    }
                }
                else
                {
                    try
                    {
                        investorAccess.UpdateInvestorCommitments(SelectedCommitment);
                    }
                    catch (Exception ex)
                    {
                        NotificationRequest.Raise(new Notification
                            {
                                Title   = "Commitment ",
                                Content = $"Fehler beim Update der Datenbank: {ex.Message}"
                            });
                        return;
                    }
                }
                string message = $"Commitment für {SelectedCommitment.PeFund.FundShortName} wurde eingefügt bzw. geändert";
                eventAggregator.GetEvent <StatusBarEvent>().Publish(message);
                break;
            }

            case "Cancel":
            {
                NotificationRequest.Raise(new Notification
                    {
                        Title   = "Commitment ",
                        Content = $"Edit Response was Cancel"
                    });
                string message = $"Änderungen wurden nicht gespeichert.";
                eventAggregator.GetEvent <StatusBarEvent>().Publish(message);
                break;
            }
            }
            EditCommitmentWindowState = WindowState.Closed;
        }
 public void ThenTheTrainingCostsShouldBeIncludedInTheCorrectMonth()
 {
     AccountProjections.ForEach(projection =>
     {
         var expectedCost = Commitments
                            .Where(c => IsIncluded(c, projection.Month, projection.Year))
                            .Sum(c => c.InstallmentAmount);
         Assert.AreEqual(expectedCost, projection.LevyFundedCostOfTraining,
                         $"Total cost of training mismatch. Month: {projection.Month}, Year: {projection.Year}, Expected amount: {expectedCost} but was: {projection.LevyFundedCostOfTraining}");
     });
 }
Ejemplo n.º 5
0
    // Use this for initialization
    private void Start()
    {
        Random.InitState(1);

        Instance = this;

        this.cachedCamPosition = Camera.main.transform.position;
        this.Commitments       = new Commitments();

        this.SetState(CurrentGameScreen.Custle);

        this.GameState = GameState.InitDefault(this.CurrentBlock);
    }
        private List <Commitments> GetCommitments(string SessionID, string OpName, int RowCount, string Commitmentfilter, out string schema, out byte[] bs, DateTime StartDate, DateTime EndDate)
        {
            int Postiveperiod = Properties.Settings.Default.SettlementPeriod;
            int Negperiod     = Postiveperiod * (-1);

            //EndDate =  EndDate.AddDays(Properties.Settings.Default.SettlementPeriod);
            EndDate = Utils.AddBusinessDays(EndDate, Postiveperiod);


            List <Commitments> CommitmentList = new List <Commitments>();

            rt = mid.DataSetListZIP(SessionID, OpName, RowCount, Commitmentfilter, out schema, out bs);


            if (rt.HasError)  // lets see what server thinks about that
            {
                Logger logger = LogManager.GetCurrentClassLogger();
                logger.Error(DateTime.Now.ToString() + "\t" + rt.ErrorInfo.ErrorReference + "\t" + rt.ErrorInfo.ErrorText);
            }
            else
            {
                DataSet   opListDS     = Utils.unZipDS(bs, schema);
                DataTable CommitmentDT = opListDS.Tables["LIST_COMMIT"];

                try
                {
                    var commitmentlist = from commitment in CommitmentDT.AsEnumerable()
                                         .Where(t => t.Field <DateTime>("COMMIT_DATE") >= StartDate &&
                                                t.Field <DateTime>("COMMIT_DATE") <= EndDate)

                                         select new
                    {
                        CommitmentID   = commitment.Field <int>("COMMIT_PARENT"),
                        CommitmentDate = commitment.Field <DateTime?>("COMMIT_DATE"),
                        CommitmentDesc = commitment.Field <string>("COMTYP_DESCRIPTION"),
                        //ComTypeDesc = commitment.Field<string>("COMTYP_DESCRIPTION"),
                        CommitmentQty     = commitment.Field <decimal?>("COMMIT_QTY"),
                        IsinID            = commitment.Field <int?>("ISIN_ID"),
                        IsinCode          = commitment.Field <string>("ISIN_CODE"),
                        IsinShortName     = commitment.Field <string>("ISIN_SHORT_NAME"),
                        IsinFullName      = commitment.Field <string>("ISIN_FULL_NAME"),
                        Account_Reference = commitment.Field <string>("ACCOUNT_REFERENCE")
                    };


                    foreach (var c in commitmentlist.ToList())
                    {
                        Commitments commitments = new Commitments();


                        int CommittmentDate = Convert.ToInt32(Utils.AddBusinessDays(Convert.ToDateTime(c.CommitmentDate), Negperiod).ToString("yyyyMMdd"));

                        commitments.Account_Reference = c.Account_Reference.ToString();
                        commitments.CommitmentDate    = CommittmentDate;
                        commitments.CommitmentDesc    = c.CommitmentDesc;
                        commitments.CommitmentID      = c.CommitmentID.ToString();
                        commitments.CommitmentQty     = (decimal)c.CommitmentQty;
                        commitments.IsinCode          = c.IsinCode;
                        commitments.IsinFullName      = c.IsinFullName;
                        commitments.IsinID            = (Int32)c.IsinID;
                        commitments.IsinShortName     = c.IsinShortName;
                        CommitmentList.Add(commitments);
                    }
                }
                catch (Exception ex)
                {
                    Logger logger = LogManager.GetCurrentClassLogger();
                    logger.Error(DateTime.Now.ToString() + "\t" + ex.Message);
                }
            }
            return(CommitmentList);
        }