示例#1
0
 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);
     }
 }
示例#2
0
 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);
     }
 }