예제 #1
0
class Manager:
    def __init__(self):
        self.main_menu = MainMenu(self)
        self.member_menu = MemberMenu(self)
        self.register_member = RegisterMember(self)
        self.register_member_menu = RegisterMemberMenu(self)
        # self.remove_member_menu  = RemoveMemberMenu(self)
        self.remove_member = RemoveFromSystem(self) 
        self.remove_member_from_sport = RemoveFromSport(self)
        self.sport_menu = SportMenu(self)
        self.remove_sport = RemoveSport(self)
        self.register_member_for_sport = RegisterMemberForSport(self)
        self.register_sport_menu = RegisterSportMenu(self)
        self.register_sport = RegisterSport(self)
        self.all_sports = AllSports(self)
        self.sport_members = SportMembers(self)
        self.detailed_member_data = DetailedMemberData(self)
        self.member_data = MemberData(self)
        self.order_member_list = OrderMemberList(self)
        self.model_members = MemberList(self)
        self.model_sports = SportList(self)
        self.sport_groups =  GroupSport(self)
        self.gotoClass("mainmenu")

    def gotoClass(self,location):
        self.location = location
        if self.location == "mainmenu":
            self.main_menu.mainMenu()
        elif self.location == "sportmenu":
            self.sport_menu.sportMenu()
        elif self.location == "membermenu":
            self.member_menu.memberMenu()
        elif self.location == "registermember":
            self.register_member.registerMember()
        elif self.location == "removesport":
            self.remove_sport.removeSport()
        elif self.location == "registermembermenu":
            self.register_member_menu.registerMemberMenu()
        elif self.location == "registermemberforsport":
            self.register_member_for_sport.registerMemberForSport()
        elif self.location == 'removememberfromsystem':
            self.remove_member.removeFromSystem()
        elif self.location == "removememberfromsport":
            self.remove_member_from_sport.removeFromSport()
        elif self.location == "memberbydata":
            self.member_data.memberData()
        elif self.location == "registersportmenu":
            self.register_sport_menu.registerSportMenu()
        elif self.location == "registersport":
            self.register_sport.registerSport()
        elif self.location == "listofsports":
            self.all_sports.allSportsList()
        elif self.location == "sportmembers":
            self.sport_members.sportMembers()
        elif self.location == "detailedmemberdata":
            self.detailed_member_data.detailedMemberData()
        elif self.location == "ordermemberslist":
            self.order_member_list.orderMemberList()
        elif self.location == "groupsport":
            self.sport_groups.groupSport()
예제 #2
0
 def __init__(self, location):
     self.__location = location
     self.__main_menu = MainMenu()
     self.__order_menu = OrderMenu()
     self.__lookup_order_menu = LookupOrderMenu()
     self.__upcoming_orders = UpcomingOrders()
     self.__new_order = NewOrder()
예제 #3
0
class MenuManager:
    def __init__(self, location):
        self.__location = location
        self.__main_menu = MainMenu()
        self.__order_menu = OrderMenu()
        self.__lookup_order_menu = LookupOrderMenu()
        self.__upcoming_orders = UpcomingOrders()
        self.__new_order = NewOrder()

        #self.__is_admin = is_admin

    def gotoClass(self, location):
        if self.__location == MAINMENU:
            # MainMenu.mainMenu(self)
            self.__main_menu.mainMenu()
            pass
        elif self.__location == ORDERMENU:
            #OrderMenu.orderMenu(self)
            self.__order_menu.orderMenu()
        elif self.__location == LOOKUPORDERMENU:
            #LookupOrderMenu.lookupOrderMenu(self)
            self.__lookup_order_menu.lookupOrderMenu()
        elif self.__location == UPCOMINGORDERS:
            #UpcomingOrders.upcomingOrders(self)
            self.__upcoming_orders.upcomingOrders()
        elif self.__location == NEWORDER:
            #NewOrder.newOrder(self)
            self.__new_order.newOrder()
예제 #4
0
 def login_menu(self):
     os.system('cls')  #  hreinsar console gluggann
     while True:
         print("Please enter your credentials.")
         username = input("Username: "******"Password: "******"Wrong Username and/or Password\n")
예제 #5
0
    def __init__(self):
        self.__isadmin = False
        self.__fullname = ""
        self.__header = Header()
        self.__location = EMPTY
        self.__last_location = EMPTY
        self.__login_menu = LoginMenu(self)
        self.__main_menu = MainMenu(self)
        self.__order_menu = OrderMenu(self)
        self.__cust_menu = CustMenu(self)
        self.__lookup_order_menu = LookupOrderMenu.LookupOrderMenu(self)
        self.__upcoming_orders = UpcomingOrders.UpcomingOrders(self)
        self.__new_order = NewOrder.NewOrder(self)
        self.__vehicle_manager = VehicleManager()
        self.__order_manager = OrderManager()
        self.__customer_manager = CustomerManager()
        self.__lookup_customer_menu = LookUpCustomerMenu(self)
        self.__update_information = UpdateInformation(self)
        self.__customer_order_history = CustomerOrderHistory(self)
        self.__look_up_customer = LookUpCustomer(self)
        self.__register_customer = RegisterCustomer(self)
        self.__cancel_order = CancelOrder(self)
        self.__change_order = ChangeOrder(self)
        # self.__chargeback_order = ChargebackOrder(self)
        self.__show_all_orders = ShowAllOrdersMenu(self)
        self.__car_menu = CarMenu(self)
        self.__car_history = VehicleHistoryMenu(self)
        self.__car_administration_menu = CarAdministrationMenu(self)
        self.__register_new_car_menu = RegisterNewCar(self)
        self.__deregister_car_menu = DeregisterCar(self)
        self.__fleet_menu = FleetMenu(self)
        self.__available = Available(self)
        self.__current_rentals = CurrentRentals(self)
        self.__overview = Overview(self)
        self.__metadata = None
        self.__price_calculator = PriceCalculator.PriceCalculator(self)
        self.__return_car = ReturnCar(self)
        self.__rent_car = RentCar(self)

        #--Start up at login loaction--
        self.gotoClass(LOGINMENU)
예제 #6
0
 def __init__(self):
     self.main_menu = MainMenu(self)
     self.member_menu = MemberMenu(self)
     self.register_member = RegisterMember(self)
     self.register_member_menu = RegisterMemberMenu(self)
     # self.remove_member_menu  = RemoveMemberMenu(self)
     self.remove_member = RemoveFromSystem(self) 
     self.remove_member_from_sport = RemoveFromSport(self)
     self.sport_menu = SportMenu(self)
     self.remove_sport = RemoveSport(self)
     self.register_member_for_sport = RegisterMemberForSport(self)
     self.register_sport_menu = RegisterSportMenu(self)
     self.register_sport = RegisterSport(self)
     self.all_sports = AllSports(self)
     self.sport_members = SportMembers(self)
     self.detailed_member_data = DetailedMemberData(self)
     self.member_data = MemberData(self)
     self.order_member_list = OrderMemberList(self)
     self.model_members = MemberList(self)
     self.model_sports = SportList(self)
     self.sport_groups =  GroupSport(self)
     self.gotoClass("mainmenu")
예제 #7
0
 def build(self):
     return MainMenu()
예제 #8
0
class MenuManager:
    def __init__(self):
        self.__isadmin = False
        self.__fullname = ""
        self.__header = Header()
        self.__location = EMPTY
        self.__last_location = EMPTY
        self.__login_menu = LoginMenu(self)
        self.__main_menu = MainMenu(self)
        self.__order_menu = OrderMenu(self)
        self.__cust_menu = CustMenu(self)
        self.__lookup_order_menu = LookupOrderMenu.LookupOrderMenu(self)
        self.__upcoming_orders = UpcomingOrders.UpcomingOrders(self)
        self.__new_order = NewOrder.NewOrder(self)
        self.__vehicle_manager = VehicleManager()
        self.__order_manager = OrderManager()
        self.__customer_manager = CustomerManager()
        self.__lookup_customer_menu = LookUpCustomerMenu(self)
        self.__update_information = UpdateInformation(self)
        self.__customer_order_history = CustomerOrderHistory(self)
        self.__look_up_customer = LookUpCustomer(self)
        self.__register_customer = RegisterCustomer(self)
        self.__cancel_order = CancelOrder(self)
        self.__change_order = ChangeOrder(self)
        # self.__chargeback_order = ChargebackOrder(self)
        self.__show_all_orders = ShowAllOrdersMenu(self)
        self.__car_menu = CarMenu(self)
        self.__car_history = VehicleHistoryMenu(self)
        self.__car_administration_menu = CarAdministrationMenu(self)
        self.__register_new_car_menu = RegisterNewCar(self)
        self.__deregister_car_menu = DeregisterCar(self)
        self.__fleet_menu = FleetMenu(self)
        self.__available = Available(self)
        self.__current_rentals = CurrentRentals(self)
        self.__overview = Overview(self)
        self.__metadata = None
        self.__price_calculator = PriceCalculator.PriceCalculator(self)
        self.__return_car = ReturnCar(self)
        self.__rent_car = RentCar(self)

        #--Start up at login loaction--
        self.gotoClass(LOGINMENU)

    def isAdmin(self):
        return self.__login_menu.isadmin

    def getFullname(self):
        return self.__login_menu.fullname

    def getMetadata(self):
        return self.__metadata

    def setMetadata(self, new_data):
        self.__metadata = new_data

    def clearMetadata(self):
        self.__metadata = None

    def getVehicleManager(self):
        return self.__vehicle_manager

    def getOrderManager(self):
        return self.__order_manager

    def getCustomerManager(self):
        return self.__customer_manager

    def setHeader(self):
        self.__fullname = self.__login_menu.fullname
        self.__isadmin = self.__login_menu.isadmin

        self.__header.setFullname(self.__fullname)
        self.__header.setIsAdmin(self.__isadmin)

    def printHeader(self):
        self.__header.printHeader(self.__location)

    def printLoginHeader(self):
        self.__header.printLoginHeader()

    def gotoClass(self, location):
        self.__last_location = self.__location
        self.__location = location
        self.__header.setNextMenu(location)

        if self.__location == MAINMENU:
            self.__main_menu.main_menu()
        elif self.__location == LOGINMENU:
            self.__login_menu.login_menu()
        elif self.__location == ORDERMENU:
            self.__order_menu.orderMenu()
        elif self.__location == SHOWALLORDERS:
            self.__show_all_orders.showOrdersMenu()
        elif self.__location == LOOKUPORDERMENU:
            self.__lookup_order_menu.lookupOrderMenu()
        elif self.__location == UPCOMINGORDERS:
            self.__upcoming_orders.upcomingOrders()
        elif self.__location == NEWORDER:
            self.__new_order.newOrder()
        elif self.__location == LOOKUPCUSTOMERMENU:
            self.__lookup_customer_menu.customerMenuSelection()
        elif self.__location == LOOKUPCUSTOMERHISTORY:
            self.__customer_order_history.getOrderHistory()
        elif self.__location == CUSTMENU:
            self.__cust_menu.customerMenu()
        elif self.__location == UPDATEINFORMATION:
            self.__update_information.updateInformation()
        elif self.__location == REGISTERCUSTOMER:
            self.__register_customer.registerCustomer()
        elif self.__location == LOOKUPCUSTOMER:
            self.__look_up_customer.lookUpCustomer()
        elif self.__location == CANCELORDER:
            self.__cancel_order.cancelOrder()
        elif self.__location == CHANGEORDER:
            self.__change_order.changeOrder()
        elif self.__location == CARMENU:
            self.__car_menu.carMenu()
        elif self.__location == CARHISTORY:
            self.__car_history.showVehicleHistory()
        elif self.__location == CARADMINISTRATIONMENU:
            self.__car_administration_menu.carAdministrationMenu()
        elif self.__location == REGISTERNEWCAR:
            self.__register_new_car_menu.registerNewCar()
        elif self.__location == DEREGISTERCAR:
            self.__deregister_car_menu.deregisterCar()
        elif self.__location == FLEETMENU:
            self.__fleet_menu.fleetMenu()
        elif self.__location == AVAILABLE:
            self.__available.available()
        elif self.__location == OVERVIEW:
            self.__overview.overview()
        elif self.__location == CURRENTRENTALS:
            self.__current_rentals.currentRentals()
        elif self.__location == PRICECALCULATOR:
            self.__price_calculator.priceCalculator()
        elif self.__location == RETURNCAR:
            self.__return_car.returnCar()
        elif self.__location == RENTCAR:
            self.__rent_car.rentCar()