def del_inventory_counts(inventory_id, update_controls=[None]): pp = DP.InventoryCountProcessor('Python210FinalDB.db') sql = pp.build_del_code(inventory_id=inventory_id) pp.execute_sql_code(sql) pp.db_con.commit() pp.db_con.close() if update_controls is not None: IOProcessor.sel_inventorycounts(update_controls[0])
def del_inventory_count(inventory_id, product_id, update_controls=[None]): ip = dp.InventoryCountProcessor(database) sql = ip.build_del_code(inventory_id=inventory_id, product_id=product_id) ip.execute_sql_code(sql) ip.db_con.commit() ip.db_con.close() if update_controls is not None: IOProcessor.sel_inventory_count(update_controls[0])
def ins_inventorycount(inventory_id, product_id, count, update_controls=[None]): pp = DP.InventoryCountProcessor('Python210FinalDB.db') sql = pp.build_ins_code(inventory_id=inventory_id, product_id=product_id, count=count) pp.execute_sql_code(sql) pp.db_con.commit() pp.db_con.close() if update_controls is not None: IOProcessor.sel_inventorycount(update_controls[0])
def sel_inventorycounts(text_widget): inventorycounts = [] pp = DP.InventoryCountProcessor('Python210FinalDB.db') sql = pp.build_sel_code() for row in pp.execute_sql_code(sql): inventorycounts.append(DM.InventoryCount(row[0], row[1], row[2])) pp.db_con.commit() pp.db_con.close() text_widget['state'] = 'normal' text_widget.delete(1.0, tk.END) if inventorycounts is None: text_widget.insert("No data available") if inventorycounts is not None: text_widget.insert(tk.END, "Inventory ID | Product ID | Count\n") for row in inventorycounts: text_widget.insert(tk.END, str(row) + "\n") text_widget['state'] = 'disabled'
def sel_inventory_count(text_widget): inventory_count = [] icp = dp.InventoryCountProcessor(database) sql = icp.build_sel_code() for row in icp.execute_sql_code(sql): inventory_count.append(dm.InventoryCount(row[0], row[1], row[2])) icp.db_con.commit() icp.db_con.close() text_widget['state'] = 'normal' text_widget.delete(1.0, tk.END) if inventory_count is None: text_widget.insert("No data available") else: text_widget.insert(tk.END, "InventoryID,ProductID,Count\n") for row in inventory_count: print(row, type(row)) text_widget.insert(tk.END, str(row) + "\n") text_widget['state'] = 'disabled'