Example #1
0
 public Transactions(List<List<string>> data, Configuration configuration)
 {
     foreach (List<string> row in data)
     {
         AddStatement(new Statement(row, configuration));
     }
 }
Example #2
0
        public ConfigurationForm()
        {
            try
            {
                configuration = Configuration.LoadDefaultConfiguration();
            }
            catch(Exception)
            {
                configuration = new Configuration();
            }

            InitializeComponent();

            ResetFields();
        }
Example #3
0
        public Statement(List<string> row, Configuration configuration)
        {
            LookupTable table = configuration.LookupTable;
            string s = "";

            if (table.Lookup(LookupEntry.Amount, row, ref s))
            {
                float amount = float.Parse(s, configuration.NumberFormatInfo);
                string value = amount.ToString();
                AddEntry(LookupEntry.Amount, value);
            }

            if (table.Lookup(LookupEntry.Checknum, row, ref s))
            {
                int checknum = int.Parse(s);
                string value = checknum.ToString();
                AddEntry(LookupEntry.Checknum, value);
            }

            if (table.Lookup(LookupEntry.Date, row, ref s))
            {
                DateTime dateTime = DateTime.ParseExact(s, configuration.DateFormat, DateTimeFormatInfo.InvariantInfo);
                int day = dateTime.Day;
                int month = dateTime.Month;
                int year = dateTime.Year;
                string value = dateTime.ToString("yyyyMMdd");
                AddEntry(LookupEntry.Date, value);
            }

            if (table.Lookup(LookupEntry.Memo, row, ref s))
            {
                string memo = s;
                string value = memo;
                AddEntry(LookupEntry.Memo, value);

            }

            if (table.Lookup(LookupEntry.Payee, row, ref s))
            {
                string payee = s;
                string value = payee;
                AddEntry(LookupEntry.Payee, value);
            }
        }
Example #4
0
 public Importer(Configuration configuration)
 {
     this.configuration = configuration;
 }