public CustMenu(Customer customer, lacrosseContext context)
 {
     this.customer         = customer;
     this.orderHistoryMenu = new OrderHistoryMenu(customer, context, new DBRepo(context), new DBRepo(context), new DBRepo(context), new DBRepo(context), new DBRepo(context));
     this.productDetails   = new ProductDetails1(customer, context, new DBRepo(context), new DBRepo(context), new DBRepo(context));
     this.checkout         = new CheckoutMenu(customer, context, new DBRepo(context), new DBRepo(context), new DBRepo(context), new DBRepo(context), new DBRepo(context), new DBRepo(context), new DBRepo(context), new DBRepo(context));
 }
        static void Main(string[] args)
        {
            lacrosseContext context = new lacrosseContext();
            IMenu           menu    = new LaunchMenu(context, new DBRepo(context), new DBRepo(context), new DBRepo(context), new DBRepo(context));

            menu.Start();
        }
        public void GetAllManagersShouldGetAllManagers()
        {
            using var tester = new lacrosseContext();
            IManagerRepo   repo      = new DBRepo(tester);
            List <Manager> manResult = repo.GetAllManagers();

            Assert.NotNull(manResult);
        }
        public void GetAllCustomerShouldGetAllCustomers()
        {
            using var tester = new lacrosseContext();
            ICustomerRepo   custRepo   = new DBRepo(tester);
            List <Customer> custResult = custRepo.GetAllCustomers();

            Assert.NotNull(custResult);
        }
 public ManagerLogin(Manager manager, lacrosseContext context, ICustomerRepo custRepo, ILocationRepo locRepo)
 {
     this.manager            = manager;
     this.custRepo           = custRepo;
     this.locRepo            = locRepo;
     this.custServices       = new CustomerServices(custRepo);
     this.locServices        = new LocationServices(locRepo);
     this.replenishInventory = new ReplenishInventory(manager, context, new DBRepo(context), new DBRepo(context), new DBRepo(context));
 }
 public ProductDetails1(Customer customer, lacrosseContext context, ICustomerRepo customerRepo, IInventoryRepo inventoryRepo, IProductRepo productRepo)
 {
     this.customer          = customer;
     this.context           = context;
     this.customerRepo      = customerRepo;
     this.inventoryRepo     = inventoryRepo;
     this.productRepo       = productRepo;
     this.customerServices  = new CustomerServices(customerRepo);
     this.inventoryServices = new InventoryServices(inventoryRepo);
     this.productServices   = new ProductServices(productRepo);
 }
Beispiel #7
0
 public ReplenishInventory(Manager manager, lacrosseContext context, ILocationRepo locationRepo, IInventoryRepo inventoryRepo, IProductRepo productRepo)
 {
     this.manager           = manager;
     this.context           = context;
     this.locationRepo      = locationRepo;
     this.inventoryRepo     = inventoryRepo;
     this.productRepo       = productRepo;
     this.locationServices  = new LocationServices(locationRepo);
     this.inventoryServices = new InventoryServices(inventoryRepo);
     this.productServices   = new ProductServices(productRepo);
 }
Beispiel #8
0
 public LaunchMenu(lacrosseContext context, ICustomerRepo custRepo, IManagerRepo managerRepo, ILocationRepo locRepo, ICartRepo cartRepo)
 {
     this.context          = context;
     this.custRepo         = custRepo;
     this.locRepo          = locRepo;
     this.cartRepo         = cartRepo;
     this.managerRepo      = managerRepo;
     this.customerServices = new CustomerServices(custRepo);
     this.locationServices = new LocationServices(locRepo);
     this.cartServices     = new CartServices(cartRepo);
     this.managerServices  = new ManagerServices(managerRepo);
 }
 public OrderHistoryMenu(Customer customer, lacrosseContext context, ICustomerRepo customerRepo, IInventoryRepo inventoryRepo, IProductRepo productRepo, IOrderRepo orderRepo, ILocationRepo locationRepo)
 {
     this.customer         = customer;
     this.customerRepo     = customerRepo;
     this.productRepo      = productRepo;
     this.orderRepo        = orderRepo;
     this.inventoryRepo    = inventoryRepo;
     this.locationRepo     = locationRepo;
     this.customerServices = new CustomerServices(customerRepo);
     this.locationService  = new LocationServices(locationRepo);
     this.productServices  = new ProductServices(productRepo);
     this.orderService     = new OrderServices(orderRepo);
     this.inventoryService = new InventoryServices(inventoryRepo);
 }
Beispiel #10
0
 public ProductDetails2(Customer customer, Sticks stick, lacrosseContext context, ICustomerRepo customerRepo, IInventoryRepo inventoryRepo, IProductRepo productRepo, ICartRepo cartRepo, ICartItemsRepo cartItemsRepo)
 {
     this.customer          = customer;
     this.stick             = stick;
     this.customerRepo      = customerRepo;
     this.productRepo       = productRepo;
     this.cartRepo          = cartRepo;
     this.cartItemsRepo     = cartItemsRepo;
     this.inventoryRepo     = inventoryRepo;
     this.customerServices  = new CustomerServices(customerRepo);
     this.inventoryServices = new InventoryServices(inventoryRepo);
     this.productServices   = new ProductServices(productRepo);
     this.cartServices      = new CartServices(cartRepo);
     this.cartItemServices  = new CartItemServices(cartItemsRepo);
 }
        public void AddCustomerShouldAddCustomer()
        {
            using var tester = new lacrosseContext();
            ICustomerRepo custRepo = new DBRepo(tester);
            Customer      newCust  = new Customer();

            newCust.FirstName  = "NewCustFirst";
            newCust.LastName   = "NewCustLast";
            newCust.email      = "*****@*****.**";
            newCust.LocationId = 2;

            custRepo.AddCustomer(newCust);
            Assert.NotNull(tester.Customer.Single(c => c.email == newCust.email));
            custRepo.DeleteACustomer(newCust);
        }
        public void GetCustomerByEmailShouldGetCustomer()
        {
            using var testContext = new lacrosseContext();
            ICustomerRepo repo = new DBRepo(testContext);

            Customer test = new Customer();

            test.FirstName  = "Test Name";
            test.LastName   = "Test LName";
            test.email      = "*****@*****.**";
            test.LocationId = 1;
            repo.AddCustomer(test);

            Customer result = repo.GetCustomerByEmail(test.email);

            Assert.NotNull(result);

            repo.DeleteACustomer(test);
        }
Beispiel #13
0
 public CheckoutMenu(Customer customer, lacrosseContext context, ICustomerRepo customerRepo, ILocationRepo locationRepo, IInventoryRepo inventoryRepo, IProductRepo productRepo, ICartRepo cartRepo, ICartItemsRepo cartItemsRepo, IOrderRepo orderRepo, ILineItemRepo lineItemRepo)
 {
     this.customer          = customer;
     this.customerRepo      = customerRepo;
     this.inventoryRepo     = inventoryRepo;
     this.locationRepo      = locationRepo;
     this.productRepo       = productRepo;
     this.orderRepo         = orderRepo;
     this.cartRepo          = cartRepo;
     this.cartItemsRepo     = cartItemsRepo;
     this.lineItemRepo      = lineItemRepo;
     this.customerServices  = new CustomerServices(customerRepo);
     this.locationServices  = new LocationServices(locationRepo);
     this.inventoryServices = new InventoryServices(inventoryRepo);
     this.productServices   = new ProductServices(productRepo);
     this.cartServices      = new CartServices(cartRepo);
     this.cartItemServices  = new CartItemServices(cartItemsRepo);
     this.orderServices     = new OrderServices(orderRepo);
     this.lineItemServices  = new lineItemServices(lineItemRepo);
 }
        public void UpdateCustomerShouldUpdateCustomer()
        {
            using var testContext = new lacrosseContext();
            ICustomerRepo repo = new DBRepo(testContext);

            Customer testUser = new Customer();

            testUser.FirstName  = "Test Name";
            testUser.LastName   = "Test LName";
            testUser.email      = "*****@*****.**";
            testUser.LocationId = 1;
            repo.AddCustomer(testUser);

            testUser.LastName = "Different LName";
            repo.UpdateCustomer(testUser);
            var result = repo.GetCustomerByEmail(testUser.email);

            Assert.Equal("Different LName", result.LastName);

            repo.DeleteACustomer(testUser);
        }
 /// <summary>
 /// parameterized constructor
 /// </summary>
 /// <param name="context"></param>
 public DBRepo(lacrosseContext context)
 {
     this.context = context;
 }