Operator.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:CS-4400-Georgia-Restaurant-Inspections-report-database 作者: itsxiaoxiaoxiaoxiaoyu 项目源码 文件源码
def searchButtonClicked(self):
        if not self.restaurantIDChoice.get():
            messagebox.showwarning("Empty restaurant ID input", "Please select restaurant ID.")
            return False
        if not self.restaurantNameChoice.get():
            messagebox.showwarning("Empty restaurant name input", "Please select restaurant name.")
            return False
        if not self.addressChoice.get():
            messagebox.showwarning("Empty address input", "Please select restaurant address.")
            return False
        # Check if the choices match (as one restaurant)
        street = self.addressChoice.get().split(",")[0]
        result = self.cursor.execute("SELECT * FROM restaurant WHERE (rid = %s AND name = %s AND street = %s AND email = %s)",
                            (int(self.restaurantIDChoice.get()),
                             self.restaurantNameChoice.get(), street, self.email))
        if not result:
            messagebox.showwarning("Error", "The restaurant ID, name and address you selected do not match.")
            return False
        self.displayReportWindow.withdraw()
        self.buildGenerateReportWindow(self.restaurantIDChoice.get(),
                                       self.restaurantNameChoice.get(),
                                       self.addressChoice.get(),
                                       self.generateReportWindow)
        self.generateReportWindow.deiconify()

#------------------------------------BUILD WINDOW METHODS------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号