public void EmployeeFlow(EmployeeServices employees, MovieServices movies)
        {
            Console.Clear();
            Console.WriteLine("Choose an action: 1)See registered users  2)See avaliable movies  3)Register a member  4)Delete a member");
            string result = Console.ReadLine();

            switch (result)
            {
            case "1":
                employees.SeeMembers(employees.RegisteredMembers);
                Console.WriteLine("Insert 1 to perform another action. Insert any other key to go back");
                string res = Console.ReadLine();
                if (res == "1")
                {
                    EmployeeFlow(employees, movies);
                }
                break;

            case "2":
                movies.SeeAvaliableMovies(movies.AllMovies, movies.RentedMovies);
                Console.WriteLine("Insert 1 to perform another action. Insert any other key to go back");
                string res1 = Console.ReadLine();
                if (res1 == "1")
                {
                    EmployeeFlow(employees, movies);
                }
                break;

            case "3":
                employees.AddMember(employees.RegisteredMembers);
                Console.WriteLine("Insert 1 to perform another action. Insert any other key to go back");
                string res2 = Console.ReadLine();
                if (res2 == "1")
                {
                    EmployeeFlow(employees, movies);
                }
                break;

            case "4":
                employees.DeleteMember(employees.RegisteredMembers, movies.RentedMovies);
                Console.WriteLine("Insert 1 to perform another action. Insert any other key to go back");
                string res3 = Console.ReadLine();
                if (res3 == "1")
                {
                    EmployeeFlow(employees, movies);
                }
                break;

            default:
                Console.WriteLine("No such action. Insert 1 to try again. Insert any other key to go back");
                string res4 = Console.ReadLine();
                if (res4 == "1")
                {
                    EmployeeFlow(employees, movies);
                }
                break;
            }
        }
        public ServicesController()
        {
            context = new DataAccess.Context();

            customerServices     = new CustomerServices();
            employeeServices     = new EmployeeServices();
            orderServices        = new OrderServices();
            orderDetailsServices = new OrderDetailsServices();
            productServices      = new ProductServices();
        }
Exemple #3
0
        public ServicesController()
        {
            this.context = new DataAccess.Context();

            this.customerServices     = new CustomerServices();
            this.employeeServices     = new EmployeeServices();
            this.orderServices        = new OrderServices();
            this.orderDetailsServices = new OrderDetailsServices();
            this.productServices      = new ProductServices();
        }