Exemple #1
0
        public void SumSidesAndCompare()
        {
            Dugovna  = Entries.Sum(x => x.Dugovna);
            Potrazna = Entries.Sum(x => x.Potrazna);

            SidesEqual = Dugovna == Potrazna;

            ProcessCommand.RaiseCanExecuteChanged();
        }
Exemple #2
0
        public void OnDialogOpened(IDialogParameters parameters)
        {
            var list = parameters.GetValue <List <AccountingJournalModel> >("entries");

            _automatic = parameters.GetValue <bool>("automatic");
            if (list.Count > 0)
            {
                BookName = list[0].VrstaTemeljnice;
            }
            Entries = new ObservableCollection <AccountingJournalModel>(list);
            SumSidesAndCompare();
            ProcessCommand.RaiseCanExecuteChanged();

            if (_automatic && CanProcess())
            {
                ProcessRows();
            }
        }
Exemple #3
0
        private void AddNewPair()
        {
            var param = new DialogParameters();

            param.Add("entry", SelectedEntry);
            _showDialog.ShowDialog("AccountPairDialog", param, result =>
            {
                if (result.Result == ButtonResult.OK)
                {
                    foreach (var ent in Entries)
                    {
                        if (ent.Konto == null || ent.Konto.Length < 3)
                        {
                            ent.Konto = result.Parameters.GetValue <string>("account");
                            ProcessCommand.RaiseCanExecuteChanged();
                        }
                    }
                }
            });
        }