Пример #1
0
        protected SqliteTestBase()
        {
            _connection = new SqliteConnection(InMemoryConnectionString);
            _connection.Open();
            var options = new DbContextOptionsBuilder <AccountantContext>()
                          .UseSqlite(_connection)
                          .Options;

            DbContext = new AccountantContext(options);
            DbContext.Database.EnsureCreated();
        }
Пример #2
0
        static void Main(string[] args)
        {
            DateTime   dat   = DateTime.Parse("06/mag/2019", System.Globalization.CultureInfo.GetCultureInfo("it-IT"));
            string     path  = "C:\\Users\\Kawik.B\\Documents\\Timesheets";
            Repository repo  = new Repository();
            var        files = Directory.GetFiles(path);
            //var works = repo.InsertWorks();
            //var travels = repo.InsertTravels();
            //var timesheets = repo.GetTimesheets(works, travels);
            PDFReader pDFReader = new PDFReader();

            pDFReader.ReadAcroFieldsFromPDF(files);

            using (var context = new AccountantContext())
            {
                context.Database.Log = Console.WriteLine;
                context.Works.AddRange(pDFReader.KeyValueWorks.Values);
                context.Travels.AddRange(pDFReader.KeyValueTravels.Values);
                context.Timesheets.AddRange(repo.GetTimesheets(pDFReader.KeyValueWorks.Values, pDFReader.KeyValueTravels.Values));
                context.SaveChanges();
            }
            Console.ReadLine();
        }
Пример #3
0
 public CategoryService(AccountantContext context)
 {
     _context = context;
 }
Пример #4
0
 public BalanceRepository(AccountantContext context)
 {
     _context = context;
 }
Пример #5
0
 public UserService(AccountantContext context)
 {
     _context = context;
 }
Пример #6
0
 public ExpenseService(AccountantContext context)
 {
     _context = context;
 }
Пример #7
0
 public EIncomeTypeController(AccountantContext context)
 {
     _context = context;
 }
Пример #8
0
 public ESpendingTypeController(AccountantContext context)
 {
     _context = context;
 }
Пример #9
0
 public GroupService(AccountantContext context)
 {
     _context = context;
 }
Пример #10
0
 public SpendingRepository(AccountantContext context, IBalanceRepository balanceRepo)
 {
     _context     = context;
     _balanceRepo = balanceRepo;
 }
Пример #11
0
 public AnualBalanceRepository(AccountantContext context, IBalanceRepository balanceRepo)
 {
     _context     = context;
     _balanceRepo = balanceRepo;
 }
Пример #12
0
 public ReportService(AccountantContext context)
 {
     _context = context;
 }
Пример #13
0
 public ShoppingListService(AccountantContext context)
 {
     _context = context;
 }