public ProductService(ISQLiteConnectionService sqaLiteConnectionService)
 {
     if (sqaLiteConnectionService == null)
     {
         throw new ArgumentNullException(nameof(sqaLiteConnectionService));
     }
     _cn = sqaLiteConnectionService.GetConnection();
 }
 public DeliveryHistoryService(ISQLiteConnectionService sqLiteConnectionService)
 {
     if (sqLiteConnectionService == null)
     {
         throw new ArgumentNullException(nameof(sqLiteConnectionService));
     }
     _cn = sqLiteConnectionService.GetConnection();
 }
 public OrderService(ISQLiteConnectionService sqLiteConnectionService, IDeliveryHistoryService deliveryHistoryService, IDataGenerator dataGenerator)
 {
     if (sqLiteConnectionService == null)
     {
         throw new ArgumentNullException(nameof(sqLiteConnectionService));
     }
     if (deliveryHistoryService == null)
     {
         throw new ArgumentNullException(nameof(deliveryHistoryService));
     }
     if (dataGenerator == null)
     {
         throw new ArgumentNullException(nameof(dataGenerator));
     }
     _cn = sqLiteConnectionService.GetConnection();
     _deliveryHistoryService = deliveryHistoryService;
     _dataGenerator          = dataGenerator;
 }
Exemple #4
0
        public Database(ISQLiteConnectionService sqLiteConnectionService, IProductService productService, ICustomerService customerService, IOrderService orderService, IDeliveryHistoryService deliveryHistoryService, IDeliveryStopService deliveryStopService)
        {
            if (sqLiteConnectionService == null)
            {
                throw new ArgumentNullException(nameof(sqLiteConnectionService));
            }

            if (productService == null)
            {
                throw new ArgumentNullException(nameof(productService));
            }

            if (customerService == null)
            {
                throw new ArgumentNullException(nameof(customerService));
            }

            if (orderService == null)
            {
                throw new ArgumentNullException(nameof(orderService));
            }

            if (deliveryHistoryService == null)
            {
                throw new ArgumentNullException(nameof(deliveryHistoryService));
            }

            if (deliveryStopService == null)
            {
                throw new ArgumentNullException(nameof(deliveryStopService));
            }

            _cn                     = sqLiteConnectionService.GetConnection();
            _productService         = productService;
            _customerService        = customerService;
            _orderService           = orderService;
            _deliveryHistoryService = deliveryHistoryService;
            _deliveryStopService    = deliveryStopService;
        }
        //public string GetUserFullName(UserDto user)
        //{
        //    return user.FirstName + " " + user.LastName;
        //}

        public UserDataService(ISQLiteConnectionService connectionService)
        {
            _dbConnection = connectionService.GetConnection();
            _dbConnection.CreateTableAsync <User>();
        }