def update_shop(self, shop): shopId = Input.input_id(self.model.tableName) shop = Input.input_update_shop(shop) older = self.model.read_shop(shopId) newShop = Check.updateShop(shop, older) check = self.model.update_shop(shopId, newShop['name'], newShop['street']) if check: self.view.display_shop_updated(shopId, older[0][1], older[0][2], newShop['name'], newShop['street'])
def update_shop(self, shop): shopId = Input.input_id(self.model.tableName) shop = Input.input_update_shop(shop) older = self.model.read_shop(shopId) newShop = Check.updateShop( shop, [older[0].ShopId, older[0].ShopName, older[0].ShopStreet]) check = self.model.update_shop(shopId, newShop['name'], newShop['street']) if check: print(older[0].ShopName, older[0].ShopStreet) self.view.display_shop_updated(shopId, newShop['name'], newShop['street'])
def update_customer(self, customer): customerId = Input.input_id(self.model.tableName) customer = Input.input_update_customer(customer) older = self.model.read_customer(customerId) newCustomer = Check.updateCustomer(customer, older) check = self.model.update_customer(customerId, newCustomer['name'], newCustomer['phone'], newCustomer['sex']) if check: self.view.display_customer_updated(customerId, newCustomer['name'], newCustomer['phone'], newCustomer['sex'])
def update_order(self, order): orderId = Input.input_id(self.model.tableName) order = Input.input_update_order(order) older = self.model.read_order(orderId) newOrder = Check.updateOrder(order, [ older[0].OrderId, older[0].CustomerId, older[0].ItemId, older[0].ShopId, older[0].OrderDate ]) print(newOrder) check = self.model.update_order(orderId, newOrder['itemId'], newOrder['shopId'], newOrder['customerId'], newOrder['date'])
def update_item(self, item): itemId = Input.input_id(self.model.tableName) item = Input.input_update_item(item) older = self.model.read_item(itemId) item = Check.updateItem(item, older) check = self.model.update_item(itemId, item['name'], item['price'], item['quantity'], item['color'], item['material'], item['description']) if check: self.view.display_item_updated(itemId, older, item['name'], item['price'], item['quantity'], item['color'], item['material'], item['description'])
def update_order(self, order): orderId = Input.input_id(self.model.tableName) order = Input.input_update_order(order) older = self.model.read_order(orderId) newOrder = Check.updateOrder(order, older) check = self.model.update_order(orderId, newOrder['itemId'], newOrder['shopId'], newOrder['customerId'], newOrder['date']) if check: self.view.display_order_updated(orderId, older, order['itemId'], order['shopId'], newOrder['customerId'], newOrder['date'])
def show_customer(self): customerId = Input.input_id(self.model.tableName) customer = self.model.read_customer(customerId) self.view.show_list_customers(customer)
def delete_shop(self): shopId = Input.input_id(self.model.tableName) check = self.model.delete_shop(shopId) if check: self.view.display_deletion(shopId, self.model.tableName)
def show_shop(self): shopId = Input.input_id(self.model.tableName) shop = self.model.read_shop(shopId) self.view.show_list_shops(shop)
def delete_order(self): orderId = Input.input_id(self.model.tableName) check = self.model.delete_order(orderId) if check: self.view.display_deletion(orderId, self.model.tableName)
def show_order(self): orderId = Input.input_id(self.model.tableName) order = self.model.read_order(orderId) self.view.show_list_orders(order)
def delete_item(self): itemId = Input.input_id(self.model.tableName) check = self.model.delete_item(itemId) if check: self.view.display_deletion(itemId, self.model.tableName)
def show_item(self): itemId = Input.input_id(self.model.tableName) items = self.model.read_item(itemId) self.view.show_list_items(items)
def delete_customer(self): customerId = Input.input_id(self.model.tableName) check = self.model.delete_customer(customerId) if check: self.view.display_deletion(customerId, self.model.tableName)