private void AddExtraDetailsRows()
        {
            //calculate the current and final balance
            decimal currentBalanceIn = 0;
            decimal currentBalanceOut = 0;
            CashBookEntries.ToList().ForEach(p => currentBalanceIn += p.Incasari);
            CashBookEntries.ToList().ForEach(p => currentBalanceOut += p.Plati);
            var currentBalanceDecimal = currentBalanceIn - currentBalanceOut;
            var totalBalanceDecimal = currentBalanceDecimal + InitialBalanceForDayDecimal;

            CashBookEntryUI currentBalance = new CashBookEntryUI()
            {
                Plati = currentBalanceOut,
                Incasari = currentBalanceIn,
                Explicatii = "Rulaj curent",
                IsExtraDetail = true
            };

            CashBookEntryUI finalBalance = new CashBookEntryUI()
            {
                Incasari = totalBalanceDecimal,
                Plati = 0,
                PlatiString = "",
                Explicatii = "Sold final",
                IsExtraDetail = true
            };

            CashBookEntries.Add(currentBalance);
            CashBookEntries.Add(finalBalance);
        }
 private bool IsValid(CashBookEntryUI item)
 {
     return !string.IsNullOrEmpty(item.Explicatii) && !string.IsNullOrEmpty(item.NrActCasa) && (item.Incasari != 0 && item.Plati == 0 || item.Incasari == 0 && item.Plati != 0);
 }
        private void AddExtraDetailsRows(decimal InitialBalanceForDayDecimal, UserCashBook cashBook, decimal? MoneyExchangeRate)
        {
            //calculate the current and final balance
            decimal currentBalanceIn = 0;
            decimal currentBalanceOut = 0;
            CashBookEntries.ToList().ForEach(p => currentBalanceIn += p.Incasari);
            CashBookEntries.ToList().ForEach(p => currentBalanceOut += p.Plati);
            var currentBalanceDecimal = currentBalanceIn - currentBalanceOut;
            var totalBalanceDecimal = currentBalanceDecimal + InitialBalanceForDayDecimal;

            CashBookEntryUI currentBalance = new CashBookEntryUI()
            {
                Plati = currentBalanceOut,
                Incasari = currentBalanceIn,
                Explicatii = "Rulaj curent",
                IsExtraDetail = true
            };

            CashBookEntryUI finalBalance = new CashBookEntryUI()
            {
                Incasari = totalBalanceDecimal,
                Plati = 0,
                PlatiString = "",
                Explicatii = "Sold final",
                IsExtraDetail = true
            };
            if (cashBook.IsLei)
            {
                finalBalance.LeiValue = finalBalance.Incasari * MoneyExchangeRate.Value;
            }

            CashBookEntries.Add(currentBalance);
            CashBookEntries.Add(finalBalance);
        }
 public void Delete(object param)
 {
     itemToDelete = param as CashBookEntryUI;
     Mediator.Instance.Register(MediatorActionType.YesNoPopupResponse, YesNoPopupResponseCallback);
     Mediator.Instance.SendMessage(MediatorActionType.OpenWindow, PopupType.YesNoDialog);
     Mediator.Instance.SendMessage(MediatorActionType.SetMessage, "Doriti sa stergeti intrarea?");
 }