public void UpdateOrder(Order _order) { string query = "UPDATE Orders SET CustomerID = @CustomerID WHERE ID = @OrderID"; List <KeyValuePair <string, object> > parameterlist = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("@CustomerID", _order.Customer.ID), new KeyValuePair <string, object>("@OrderID", _order.ID) }; SQL_CRUD_Methods.SQLUpdate(query, parameterlist); }
public void EditOrderedAmount(int _prodID, int _orderID, int _amount) { string query = "UPDATE [dbo].[Order_Product] SET Amount = @Amount WHERE OrderID = @OrderID AND ProductID = @ProductID"; List <KeyValuePair <string, object> > parameterlist = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("@OrderID", _orderID), new KeyValuePair <string, object>("@ProductID", _prodID), new KeyValuePair <string, object>("@Amount", _amount) }; SQL_CRUD_Methods.SQLUpdate(query, parameterlist); }
public void EditProduct(Product _product) { string query = "UPDATE Product SET Volume = @Volume, VolumeType = @VolumeType, Active = @Active WHERE ID = @ProductID"; List <KeyValuePair <string, object> > parameterlist = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("@ProductID", _product.ID), new KeyValuePair <string, object>("@Volume", _product.Volume), new KeyValuePair <string, object>("@VolumeType", _product.VolumeType), new KeyValuePair <string, object>("@Active", _product.Active) }; SQL_CRUD_Methods.SQLUpdate(query, parameterlist); }
public void UpdateDelivery(Delivery _delivery) { string query = "UPDATE Delivery SET DateTime = @DateTime, ExternalID = @ExternalID WHERE ID = @DeliveryID"; string extID = _delivery.ExternalID; if (_delivery.ExternalID == null || _delivery.ExternalID == "") { extID = "X"; } List <KeyValuePair <string, Object> > parameterlist = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("@DateTime", DateTime.Now), new KeyValuePair <string, object>("@ExternalID", extID), new KeyValuePair <string, object>("@DeliveryID", _delivery.ID) }; SQL_CRUD_Methods.SQLUpdate(query, parameterlist); }