Esempio n. 1
0
        internal static Account Read(System.IO.FileInfo file)
        {
            MoneyParser = new SimpleMoneyParser();

            FileReader reader = new FileReader(file.FullName);
            var        lines  = reader.ReadAllLines();
            string     name   = ParseFileName(file.Name);

            Console.Out.WriteLine("\n\n{0}", name);

            var utSaldo = ParseSaldoLine(lines[0]);

            lines.RemoveAt(0);
            lines.RemoveAt(0); //Headings

            var innSaldo = ParseSaldoLine(lines[lines.Count - 1]);

            lines.RemoveAt(lines.Count - 1);

            Account result = new Account(file.Name, name, innSaldo, utSaldo);


            foreach (var line in lines)
            {
                AccountLine aLine = ParseLine(line, name);
                result.AddLine(aLine);
            }

            return(result);
        }
Esempio n. 2
0
 internal void Remove(AccountLine accountLine)
 {
     lines.Remove(accountLine);
 }
Esempio n. 3
0
 internal void AddLine(AccountLine aLine)
 {
     lines.Add(aLine);
 }