src/main/java/com/qa/IMS/controller/OrderController.java
@Override
	public Order update() {
		LOGGER.info("Please enter the id of the order you would like to update");
		Long id = utils.getLong();
		LOGGER.info("Please enter a product ID to add");
		Long product_id = utils.getLong();
		LOGGER.info("Please enter the quantity of product to order");
		Long quantity = utils.getLong();
		ItemDAO itemDAO = new ItemDAO();
		Item item = itemDAO.readItem(product_id);
		double total = item.getPrice() * quantity;
		Order order = orderDAO.update(new Order(id, product_id, quantity, total));
		LOGGER.info(order.toString());
		return order;
	}
/**
	 * Updates an existing customer by taking in user input
	 */
Updates an existing customer by taking in user input
Updates an existing customer by taking in user input
@Override
	public Order update() {
		LOGGER.info("Please enter the id of the order you would like to update");
		Long id = utils.getLong();
		LOGGER.info("Please enter a product ID to add");
		Long product_id = utils.getLong();
		LOGGER.info("Please enter the quantity of product to order");
		Long quantity = utils.getLong();
		ItemDAO itemDAO = new ItemDAO();
		Item item = itemDAO.readItem(product_id);
		double total = item.getPrice() * quantity;
		Order order = orderDAO.update(new Order(id, product_id, quantity, total));
		LOGGER.info(order.toString());
		return order;
	}
@ Override public Order update ( ) { LOGGER . info ( "Please enter the id of the order you would like to update" ) ; Long id = utils . getLong ( ) ; LOGGER . info ( "Please enter a product ID to add" ) ; Long product_id = utils . getLong ( ) ; LOGGER . info ( "Please enter the quantity of product to order" ) ; Long quantity = utils . getLong ( ) ; ItemDAO itemDAO = new ItemDAO ( ) ; Item item = itemDAO . readItem ( product_id ) ; double total = item . getPrice ( ) * quantity ; Order order = orderDAO . update ( new Order ( id , product_id , quantity , total ) ) ; LOGGER . info ( order . toString ( ) ) ; return order ; }
Updates an existing customer by taking in user input
Updates an existing customer by taking in user input