예제 #1
0
 def AddNewRoom(self):
     Gre=self.GetModel()
     Write_File = ReadAndOpenFile.AWrite_File_Room(self)
     for i in Gre:
         Write_File.write(i)
     Write_File.close()
     Open_File=ReadAndOpenFile.Read_File_Room(self)
     List_Show=Open_File.readlines()
     self.Scroll=Scrollbar(self.Bottow, width=20)
     self.Scroll.place(x=615, y=230)
     self.List_Box=Listbox(self.Bottow, yscrollcommand=self.Scroll.set, width=65, font="arial 12 bold", bd=5)
     self.Scroll.config(command=self.List_Box.yview)
     for i in range(len(List_Show)):
         self.List_Box.insert(END, str(i) + " " + List_Show[i])
     self.List_Box.place(x=20, y=230)
예제 #2
0
    def CheckOutForCustomer(self):
        Open_File=ReadAndOpenFile.Read_File_BAction(self)
        List_Show=Open_File.readlines()
        Open_File.close()

        if (self.Bottow_Frame_EnIDRoom == ""):
            return mb.showerror("Error", "Bạn chưa nhập Thông Tin Tìm Kiếm")
        else:
            for i in range(len(List_Show)):
                if(self.Bottow_Frame_EnIDRoom.get() in List_Show[i]):
                     Data_Show=List_Show[i]
        Write_File=ReadAndOpenFile.Write_File_BAction(self)
        for i in List_Show:
            if (i!=Data_Show):
                Write_File.write(i)
        Write_File.close()
예제 #3
0
 def Upload(self,event=None):
     Open_File = ReadAndOpenFile.Read_File_BAction(self)
     List_Show = Open_File.readlines()
     self.Scroll = Scrollbar(self.Bottow, width=20)
     self.List_Box = Listbox(self.Bottow, yscrollcommand=self.Scroll.set, width=65,
                             font="arial 10 underline bold italic", bd=5)
     self.Scroll.config(command=self.List_Box.yview)
     for i in range(len(List_Show)):
         self.List_Box.insert(END, str(i) + " " + List_Show[i])
     self.List_Box.place(x=20, y=300)
예제 #4
0
 def FeedBack(self):
     Open_File = ReadAndOpenFile.Read_File_FeedBack(self)
     List_Show = Open_File.read().split(" ")
     Open_File.close()
     self.DataFile = list()
     for i in List_Show:
         self.DataFile.append(int(i))
     for i in range(len(self.DataFile)):
         if (self.VeryBad.get() == 1):
             self.DataFile[0] += 10
             break
         if (self.Bad.get() == 1):
             self.DataFile[1] += 10
             break
         if (self.OK.get() == 1):
             self.DataFile[2] += 10
             break
         if (self.Good.get() == 1):
             self.DataFile[3] += 10
             break
         if (self.VeryGood.get() == 1):
             self.DataFile[4] += 10
             break
     Date_Show = list()
     for i in range(len(self.DataFile)):
         Date_Show = [
             str(self.DataFile[0]) + " ",
             str(self.DataFile[1]) + " ",
             str(self.DataFile[2]) + " ",
             str(self.DataFile[3]) + " ",
             str(self.DataFile[4])
         ]
     Write_File = ReadAndOpenFile.Write_File_FeedBack(self)
     for i in Date_Show:
         Write_File.write(i)
     Write_File.close()
     return self.DataFile
예제 #5
0
    def Search_Customer(self):
        Open_File = ReadAndOpenFile.Read_File_Customer(self)
        List_Show = Open_File.readlines()
        Open_File.close()
        Data_Show = list()

        if (self.Bottow_Frame_EnPhoneCustomer.get() == ""):
            return mb.showerror("Error", "Bạn chưa nhập Thông Tin Tìm Kiếm")
        else:
            for LINE in List_Show:
                if (self.Bottow_Frame_EnPhoneCustomer.get() in LINE):
                    Data_Show.append(LINE)
                    break
        if (self.Bottow_Frame_EnPhoneCustomer.get() not in LINE):
            mb.showerror("Error", "Khách Hàng Không Tồn Tại")
        self.Bottow_Frame_Search = Entry(self.Bottow,
                                         width=55,
                                         font="arial 12 bold",
                                         bd=5)
        self.Bottow_Frame_Search.insert(END, Data_Show)
        self.Bottow_Frame_Search.place(x=20, y=160)
예제 #6
0
 def ReturnRoom(self):
     Gre = self.GetModel()
     Open_File = ReadAndOpenFile.AWrite_File_Room(self)
     for i in Gre:
         Open_File.write(i)
     Open_File.close()
예제 #7
0
    def __init__(self, Master):
            self.Master = Master
            '''
            Design Frame
            '''
            self.Top = Frame(Master, height=50, bg='white')
            self.Top.pack(fill=X)
            self.Bottow = Frame(Master, height=600, bg="#99ccff")
            self.Bottow.pack(fill=X)
            '''
            Design Top Frame
            '''
            self.Top_Frame_Titel = Label(self.Top, text="Action Hotel", font="arial 28 underline bold italic", fg="#004d99", bg="white")
            self.Top_Frame_Titel.place(x=250, y=1)
            self.Top_Frame_Time = Label(self.Top, text="Day&Time: " + time)
            self.Top_Frame_Time.place(x=650, y=20)
            '''
            Design Bottow Frame
            '''
            self.Bottow_Frame_LbIDRoom = Label(self.Bottow, text="IDRoom: ", font="arial 12 underline bold", fg="#004d99",
                                               bg="#99ccff")
            self.Bottow_Frame_LbIDRoom.place(x=82, y=20)
            self.Bottow_Frame_EnIDRoom = Entry(self.Bottow, bg="white", bd=4, width=25)
            self.Bottow_Frame_EnIDRoom.place(x=155, y=20)
            self.Bottow_Frame_LbPrice = Label(self.Bottow, text="PriceRoom: ", font="arial 12 underline bold",
                                              fg="#004d99", bg="#99ccff")
            self.Bottow_Frame_LbPrice.place(x=60, y=50)
            self.Bottow_Frame_EnPrice = Entry(self.Bottow, bg="white", bd=4, width=25)
            self.Bottow_Frame_EnPrice.place(x=155, y=50)
            self.Bottow_Frame_LbStatus = Label(self.Bottow, text="StatusRoom: ", font="arial 12 underline bold",
                                               fg="#004d99", bg="#99ccff")
            self.Bottow_Frame_LbStatus.place(x=50, y=80)
            self.Bottow_Frame_EnStatus = Entry(self.Bottow, bg="white", bd=4, width=25)
            self.Bottow_Frame_EnStatus.place(x=155, y=80)
            Option_CBKind = ["Day", "Night"]
            Option_CBTimeSpend = ["VIP", "Nomarl"]
            self.Bottow_Frame_LbTimeSpend = Label(self.Bottow, text="UsedTime: ", font="arial 12 underline bold", bg="#99ccff",
                                                  fg="#004d99")
            self.Bottow_Frame_LbTimeSpend.place(x=68, y=110)
            self.Bottow_Frame_CbTimeSpend = Combobox(self.Bottow, values=Option_CBKind, width=23)
            self.Bottow_Frame_CbTimeSpend.place(x=155, y=110)
            self.Bottow_Frame_LbKind = Label(self.Bottow, text="KindRoom: ", font="arial 12 underline bold", bg="#99ccff",
                                             fg="#004d99")
            self.Bottow_Frame_LbKind.place(x=64, y=140)
            self.Bottow_Frame_CbKind = Combobox(self.Bottow, values=Option_CBTimeSpend, width=23)
            self.Bottow_Frame_CbKind.place(x=155, y=140)
            self.Bottow_Frame_BtnAdd = Button(self.Bottow, text="Bill", font="arial 10 underline bold", bg="white",
                                              fg="#004d99", width=15, command=self.BillForCustomer)
            self.Bottow_Frame_BtnAdd.place(x=20, y=180)

            self.Bottow_Frame_BtnCheckOut = Button(self.Bottow, text="CheckOut", font="arial 10 underline bold", bg="white",
                                                   fg="#004d99", width=15, command=self.CheckOutForCustomer)
            self.Bottow_Frame_BtnCheckOut.place(x=20, y=220)
            self.Bottow_Frame_BtnClear = Button(self.Bottow, text="ClearRoom", font="arial 10 underline bold", bg="white",
                                                fg="#004d99", width=15, command=self.ReturnRoom)
            self.Bottow_Frame_BtnClear.place(x=20, y=260)

            Open_File =ReadAndOpenFile.Read_File_BAction(self)
            List_Show = Open_File.readlines()
            self.Scroll = Scrollbar(self.Bottow, width=20)
            self.List_Box = Listbox(self.Bottow, yscrollcommand=self.Scroll.set, width=65, font="arial 10 underline bold italic", bd=5)
            self.Scroll.config(command=self.List_Box.yview)
            for i in range(len(List_Show)):
                self.List_Box.insert(END, str(i) + " " + List_Show[i])
            self.List_Box.place(x=20, y=300)
            self.Bar = IntVar()
            self.Bottow_Frame_DVbar=Checkbutton(self.Bottow, text="Bar_mini:50000", bg="#99ccff", variable=self.Bar, font="arial 10 underline bold", fg="#004d99")
            self.Bottow_Frame_DVbar.place(x=380, y=20)
            self.Food=IntVar()

            self.Gif=IntVar()
            self.Bottow_Frame_DVFood=Checkbutton(self.Bottow, text="Food_Room:40000", bg="#99ccff", variable=self.Food, font="arial 10 underline bold", fg="#004d99")
            self.Bottow_Frame_DVFood.place(x=380, y=50)
            self.Bottow_Frame_DVGif=Checkbutton(self.Bottow, text="GIF_customer:30000", bg="#99ccff", variable=self.Gif, font="arial 10 underline bold", fg="#004d99")
            self.Bottow_Frame_DVGif.place(x=380, y=80)

            self.Bottow_Frame_Lbbill = Label(self.Bottow, text="Payment of service invoices ", font="arial 15 underline bold italic", bg="#99ccff",
                                             fg="#004d99")
            self.Bottow_Frame_Lbbill.place(x=600, y=20)
            '''
            Design Bo viền
            '''
            self.Bottow_Frame_LbVien=Label(self.Bottow, height=50)
            self.Bottow_Frame_LbVien.place(x=540, y=0)
예제 #8
0
 def CheckInForCustomer(self):
     Gre=self.GetModel()
     Write_File=ReadAndOpenFile.Write_File_BAction(self)
     for i in Gre:
         Write_File.write(i)
     Write_File.close()