public string DeleteOrder(clsOrder prOrder) { try { int lcRecCount = clsDBConnection.Execute( "DELETE FROM Orders WHERE OrderNumber = @OrderNumber", prepareOrderParameters(prOrder)); if (lcRecCount == 1) { return("One Order Deleted"); } else { return("Unexpected Product Delete count: " + lcRecCount); } } catch (Exception ex) { return(ex.GetBaseException().Message); } }
public string CreateOrder(clsOrder prOrder) { // insert try { int lcRecCount = clsDBConnection.Execute("INSERT INTO Orders " + "(Quanity, Name, Address, Phone, PricePerItem, ProductsName) " + "VALUES (@Quanity, @Name, @Address, @Phone, @PricePerItem, @ProductsName)", prepareOrderParameters(prOrder)); if (lcRecCount == 1) { return("Your Order Has Been Submitted"); } else { return("Unexpected Product Insert Count: " + lcRecCount); } } catch (Exception ex) { return(ex.GetBaseException().Message); } }