def delete(self):
        if self.combo_select_Car.get() == "":
            mb.showwarning("System message",
                           "Select the reg_Num in the combo box")
        else:
            select_car = self.combo_select_Car.get()
            car = Car(Reg_Num=select_car)
            output = Officestaff().deleteCar(car)

            if output:
                mb.showinfo("System message", "Delete successfully")
            else:
                mb.showwarning("System message", " Not successfully deleted")
Exemplo n.º 2
0
 def submit(self):
     if self.combo_Reg_Num.get() == "" or self.combo_componentName.get(
     ) == "":
         mb.showwarning("System message", "Check the field and fill it")
     else:
         reg_Num = self.combo_Reg_Num.get()
         component_name = self.combo_componentName.get()
         car = Car(reg_Num)
         accessories = Accessories(component_Name=component_name)
         results = Officestaff().add_Upgrade(car, accessories)
         if results:
             mb.showinfo("Successful", "insert Sccessful")
         else:
             mb.showwarning("Error message", "insert not successful")
Exemplo n.º 3
0
    def add(self):
        if self.fld_Reg_Num.get()=="" or self.fld_Colour.get()=="" or self.fld_Num_Doors.get() =="" or self.combo_Model_name.get()=="":
           mb.showwarning("System message","Check the field and fill it")
        else:
            Reg_Num = self.fld_Reg_Num.get()
            Colour = self.fld_Colour.get()
            Num_Doors = self.fld_Num_Doors.get()
            modelname= self.combo_Model_name.get()

            car = Car(Reg_Num, Colour, Num_Doors)
            carModel=CarModel(model_name=modelname)


            outPut = Officestaff().Addcardetails(car,carModel)
            if outPut:
                mb.showinfo("Successful", "insert Succesfull")
            else:
                    mb.showwarning("Error message", "insert is not successful")
    def add(self):
        if self.fld_Model_id.get() == "" or self.fld_Modelname.get(
        ) == "" or self.fld_price.get(
        ) == "" or self.combo_Manufacturename.get() == "":
            mb.showwarning("System message", "Check the field and fill it")
        else:

            model_Id = self.fld_Model_id.get()
            model_Name = self.fld_Modelname.get()
            model_price = self.fld_price.get()
            manufacture_Name = self.combo_Manufacturename.get()

            carModel = CarModel(model_Id, model_Name, model_price)
            manufacture = Manufacture(manufacturename=manufacture_Name)

            outPut = Officestaff().add_carModel(carModel, manufacture)
            if outPut:
                mb.showinfo("Successful", "insert Succesfull")
            else:
                mb.showwarning("Error message", "insert is not successful")
    def search(self):
        if self.combo_select_Model.get(
        ) == "" and self.combo_select_Manufacture.get() == "":
            mb.showwarning(
                "System message",
                "select at least one of above model name or Manufacture name")
        else:
            result = Officestaff().searchCar(
                self.combo_select_Model.get(),
                self.combo_select_Manufacture.get())
            print(result)

            temp_Window = Tk()
            temp_Window.title("Search result")

            for i in range(len(result)):
                for j in range(len(result[0])):
                    temp_Entry = Entry(temp_Window, width=10, fg="red")
                    temp_Entry.grid(row=i, column=j)
                    temp_Entry.insert(END, result[i][j])
            temp_Window.mainloop()
    def add(self):
        if self.fld_Manufacture_id.get() == "" or self.fld_ManufactureName.get(
        ) == "":
            mb.showwarning("System message", "Check the field and fill it")
        else:
            self.manufacture = Manufacture(self.fld_Manufacture_id.get(),
                                           self.fld_ManufactureName.get())
            # manufacture=Manufacture(manufacture_id=None,manufacturename=None)
            # manufacture.setmanufacture_id(self.fld_Manufacture_id.get())
            # manufacture.setmanufacturename(self.fld_ManufactureName.get())
            # print(manufacture.getmanufacture_id())
            # self.manufacture.getmanufacture_id()
            self.result = Officestaff().addmanufacture(self.manufacture)
            if self.result:

                mb.showinfo("Successful", "insert successfully")
                self.fld_ManufactureName.delete(0, 'end')
                self.fld_Manufacture_id.delete(0, 'end')

            else:
                mb.showwarning(
                    "Systemmessage",
                    "Manufacturename or Manufacture_id already exist")
Exemplo n.º 7
0
 def getModelname(self):
     self.combo_Model_name["values"] = Officestaff().takeModelname()
Exemplo n.º 8
0
 def component_List(self):
     self.combo_componentName["values"] = Officestaff().take_ComponentName()
Exemplo n.º 9
0
 def reg_Numlist(self):
     self.combo_Reg_Num["values"] = Officestaff().take_Regnum()
 def getManufacturename(self):
     self.combo_Manufacturename["values"] = Officestaff(
     ).takemanufacturename()
 def selectCar(self):
     self.combo_select_Car["values"] = Officestaff().take_Regnum()
 def select_Manufacture(self):
     self.combo_select_Manufacture["values"] = Officestaff(
     ).takemanufacturename()
 def select_Model(self):
     self.combo_select_Model["values"] = Officestaff().takeModelname()