<commit_before>using Caliburn.Micro;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using WTFDTMG.Models;
using ImpromptuInterface;
using System.Collections.ObjectModel;

namespace WTFDTMG.ViewModels
{
    public class DataEntryViewModel : Screen, IDataEntryViewModel
    {
        public DataEntryViewModel()
        {
            DisplayName = "Enter Items";

            var account = new Account();
            Accounts = new ObservableCollection<IAccount>(Impromptu.AllActLike<IAccount>(account.All(), typeof(IAccount)));

            var location = new Location();
            Locations = new ObservableCollection<ILocation>(Impromptu.AllActLike<ILocation>(location.All(), typeof(ILocation)));

            Date = DateTime.Today;
        }

        private DateTime _Date;
        public DateTime Date
        {
            get { return _Date; }
            set
            {
                _Date = value;
                NotifyOfPropertyChange(() => Date);
            }
        }

        public decimal Amount { get; set; }

        public ObservableCollection<IAccount> Accounts { get; set; }
        public ObservableCollection<ILocation> Locations { get; set; }

        private IAccount _selectedAccount;
        public IAccount SelectedAccount
        {
            get { return _selectedAccount; }
            set
            {
                _selectedAccount = value;
                NotifyOfPropertyChange(() => SelectedAccount);
            }
        }

        private ILocation _selectedLocation;
        public ILocation SelectedLocation
        {
            get { return _selectedLocation; }
            set
            {
                _selectedLocation = value;
                NotifyOfPropertyChange(() => SelectedLocation);
            }
        }

        public void Ok()
        {
            MessageBox.Show("ok");
        }

        public bool CanOk
        {
            get 
            { 
                return false; 
            }
        }

        public void Cancel()
        {
            MessageBox.Show("Cancel");
        }
    }<commit_msg>started working on IDataErrorInfo<commit_after>using Caliburn.Micro;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using WTFDTMG.Models;
using ImpromptuInterface;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace WTFDTMG.ViewModels
{
    public class DataEntryViewModel : Screen, IDataEntryViewModel, IDataErrorInfo
    {
        public DataEntryViewModel()
        {
            DisplayName = "Enter Items";

            var account = new Account();
            Accounts = new ObservableCollection<IAccount>(Impromptu.AllActLike<IAccount>(account.All(), typeof(IAccount)));

            var location = new Location();
            Locations = new ObservableCollection<ILocation>(Impromptu.AllActLike<ILocation>(location.All(), typeof(ILocation)));

            Date = DateTime.Today;
        }

        private DateTime _Date;
        public DateTime Date
        {
            get { return _Date; }
            set
            {
                _Date = value;
                NotifyOfPropertyChange(() => Date);
            }
        }

        public decimal Amount { get; set; }

        public ObservableCollection<IAccount> Accounts { get; set; }
        public ObservableCollection<ILocation> Locations { get; set; }

        private IAccount _selectedAccount;
        public IAccount SelectedAccount
        {
            get { return _selectedAccount; }
            set
            {
                _selectedAccount = value;
                NotifyOfPropertyChange(() => SelectedAccount);
            }
        }

        private ILocation _selectedLocation;
        public ILocation SelectedLocation
        {
            get { return _selectedLocation; }
            set
            {
                _selectedLocation = value;
                NotifyOfPropertyChange(() => SelectedLocation);
            }
        }

        public string Reason { get; set; }

        public void Ok()
        {
            MessageBox.Show("ok");
        }

        public bool CanOk
        {
            get 
            { 
                return false; 
            }
        }

        public void Cancel()
        {
            MessageBox.Show("Cancel");
        }

        public string Error
        {
            get { throw new NotImplementedException(); }
        }

        public string this[string columnName]
        {
            get 
            {
                string returnVal = string.Empty;
                if (columnName == "Date")
                {
                    if (Date <= DateTime.MinValue || Date >= DateTime.MaxValue)
                    {
                        returnVal = "Please enter a value date.";
                    }
                }
                else if (columnName == "Reason")
                {
                    if (string.IsNullOrEmpty(Reason))
                    {
                        returnVal = "Please enter a reason / description of the purchase.";
                    }
                }
                return returnVal;
            }
        }
    }
{'fraction_non_alphanumeric': 0.07861936720997123, 'fraction_numerical': 0.0, 'mean_word_length': 1.4569006123410269, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3738864', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1200, 'n_words': 291}