void updateDeliveredOrder(string orderID) { newOrder = new cInsertUpdateOrder(); newOrder.sqlQuery = "update ORDERS set orderStatus = 1 where orderID = @orderId"; newOrder.orderId = Convert.ToInt32(orderID); newOrder.isOrderDelivered(); }
void deleteOrder() { int orderId = Convert.ToInt32(dGridView.CurrentRow.Cells["orderId"].Value); newOrder = new cInsertUpdateOrder(); newOrder.sqlQuery = "delete from ORDERS where orderID = @orderId"; newOrder.orderId = orderId; newOrder.deleteOrder(); }
void insertNewOrder() { newOrder = new cInsertUpdateOrder(); newOrder.sqlQuery = "insert into ORDERS (staffID, productID, tableID, billID, quantity, orderStatus, orderPrice) values " + "((select staffID from STAFFS where staffUserName = @userName), " + "(select productID from PRODUCTS where productName = @product), @table, @billID, @quantity, @status, @orderPrice)"; getOrderParameters(); newOrder.insertOrder(); clearInputItems(); }
void updateSelectedOrder() { int orderId = Convert.ToInt32(dGridView.CurrentRow.Cells["orderId"].Value); newOrder = new cInsertUpdateOrder(); newOrder.sqlQuery = "update ORDERS set productID = (select productID from PRODUCTS where " + "productName = @product), quantity = @quantity, orderStatus = 0, orderPrice = @orderPrice " + "where orderID = @orderId"; newOrder.orderId = orderId; newOrder.product = CBoxProducts.SelectedItem.ToString(); newOrder.quantity = Convert.ToInt32(TBoxProductAmount.Text); decimal price = categoryList[CBoxCategories.SelectedIndex].productList[CBoxProducts.SelectedIndex].price; newOrder.orderPrice = newOrder.quantity * price; newOrder.updateOrder(); }