Exemple #1
0
 public OrderService(OrdersBDContext context, IProductService productService, IClientService clientService,
                     IManagerService managerService)
 {
     _context        = context;
     _productService = productService;
     _clientService  = clientService;
     _managerService = managerService;
 }
Exemple #2
0
 protected override async Task ExecuteAsync(CancellationToken stoppingToken)
 {
     try
     {
         string          path            = ConfigurationManager.AppSettings["SaleInfoDirPath"];
         OrdersBDContext ordersBdContext = new OrdersBDContext("SalesDB");
         using (FileWatcher fileWatcher = new FileWatcher(new CsvFileReader <SalesInfoMap, SalesInfo>(), path,
                                                          new SaleInfoProcessor(new OrderService(ordersBdContext, new ProductService(ordersBdContext),
                                                                                                 new ClientService(ordersBdContext), new ManagerService(ordersBdContext)))))
             fileWatcher.StartWatching();
     }
     catch (Exception e)
     {
         _logger.LogError(e, " error ");
     }
 }
Exemple #3
0
 static void Main(string[] args)
 {
     try
     {
         string          path            = ConfigurationManager.AppSettings["SaleInfoDirPath"];
         OrdersBDContext ordersBdContext = new OrdersBDContext("SalesDB");
         using (FileWatcher fileWatcher = new FileWatcher(new CsvFileReader <SalesInfoMap, SalesInfo>(), path,
                                                          new SaleInfoProcessor(new OrderService(ordersBdContext, new ProductService(ordersBdContext),
                                                                                                 new ClientService(ordersBdContext), new ManagerService(ordersBdContext)))))
         {
             fileWatcher.StartWatching();
             Thread.Sleep(5000);
             fileWatcher.StopWatching();
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Exemple #4
0
 public ManagerService(OrdersBDContext context)
 {
     _context = context;
 }
Exemple #5
0
 public ClientService(OrdersBDContext context)
 {
     _context = context;
 }
Exemple #6
0
 public ProductService(OrdersBDContext context)
 {
     _context = context;
 }