def get_item_form_le(self): pdt = ProductDao() sdt = SaleDao() code = self.ui.line_code.text() name = self.ui.line_name.text() price = self.ui.line_price.text() count = self.ui.line_count.text() margin = self.ui.line_margin.text() pdt.insert_product(code=code, name=name) sdt.insert_item(price=price,salecnt=count,marginrate=margin) return self.create_item(code, name)
def product_dao_test(): global pdt pdt = ProductDao() [print(row) for row in pdt.select_product()] [ print(row) for row in pdt.select_product( sql="select * from product where code like %s", code='A%') ] sdt = SaleDao() [print(row) for row in sdt.select_item()] # sdt.insert_item(code='A001', price=5000, saleCnt=10, marginRate=10) [print(row) for row in sdt.select_item(no=1)] select_product() pdt.insert_product("Insert into product values(%s, %s)", 'C001', '라떼') select_product() pdt.update_product("update product set name = %s where code = %s", '라떼수정', 'C001') select_product() pdt.delete_product("delete from product where code = %s", 'C001') select_product()
def get_item_form_le_addpdt(self, le_code, le_name): pdt = ProductDao() code = le_code name = le_name pdt.insert_product(code, name) return self.create_item(code, name)