Example #1
0
 public models.Manager SignIn()
 {
     models.Manager manager = new models.Manager();
     Console.Write("\nEnter Your Name: ");
     manager.Name = Console.ReadLine();
     Console.Write("Enter Your Password: ");
     manager.Password = Console.ReadLine();
     return(manager);
 }
        public ManagerInventoryMenu(models.Manager manager, IManagerRepo managerRepo, IMessagingService service)
        {
            this.manager = manager;
            this.service = service;

            this.managerService   = new ManagerService(managerRepo);
            this.locationService  = new LocationService((ILocationRepo)managerRepo);
            this.inventoryService = new InventoryService((IInventoryRepo)managerRepo);
            this.orderService     = new OrderService((IOrderRepo)managerRepo);
            this.productService   = new ProductService((IProductRepo)managerRepo);
        }
Example #3
0
        public void Start()
        {
            do
            {
                Console.WriteLine("\nWelcome Manager! What would you like to do?");
                Console.WriteLine("[0] Login?");
                Console.WriteLine("[1] Go back to the main menu?");
                userInput = Console.ReadLine();
                switch (userInput)
                {
                case "0":
                    models.Manager loginManager = SignIn();
                    try{
                        managerService.SignInManager(loginManager.Name, loginManager.Password);
                    } catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                        break;
                    }
                    manager = managerService.GetManager(loginManager.Name, loginManager.Password);
                    managerInventoryMenu = new ManagerInventoryMenu(manager, (IManagerRepo)managerService.repo, new MessagingService());
                    managerInventoryMenu.Start();
                    break;

                case "1":
                    //back to main menu message
                    service.BackToMainMenuMessage();
                    break;

                default:
                    //invalid input message;
                    service.InvalidInputMessage();
                    break;
                }
            } while (!userInput.Equals("1"));
        }
Example #4
0
 public ManagerMenu(IManagerRepo repo, IMessagingService service)
 {
     this.manager        = new models.Manager();
     this.service        = service;
     this.managerService = new ManagerService(repo);
 }