示例#1
0
        public static bool DeleteOrder(OrderHeader orderID)
        {
            bool returnValue = false;
            SQLWrapper sw = new SQLWrapper();
            sw.BeginTransaction();
            try
            {
                SqlParameter[] param =
            {
                new SqlParameter("OrderID",typeof(Guid))
            };
                param[0].Value = orderID;
                sw.ExecuteStoredProcedureInTransaction("ORD_DeleteOrder", param);

                sw.CommitTransaction();
                returnValue = true;
            }
            catch
            {
                sw.RollBackTransaction();
            }
            finally
            {
                sw = null;
            }
            return returnValue;
        }
示例#2
0
        public static bool AddOrder(OrderHeader order)
        {
            bool returnValue = false;
            SqlParameter[] param;
            SQLWrapper sw = new SQLWrapper();
            sw.BeginTransaction();
            try
            {
                param = prepareSQLParameters(order, true);
                sw.ExecuteStoredProcedureInTransaction("ORD_AddOrderHeader", param);
                order.OrderID = (Guid)param[0].Value;

                addUpdateChildTablesForOrder(order, ref sw);

                sw.CommitTransaction();
                returnValue = true;
            }
            catch
            {
                sw.RollBackTransaction();
            }
            finally
            {
                sw = null;
            }
            return returnValue;
        }
示例#3
0
 public static bool UpdateOrderFinishedSizes(Guid orderID, OrderFinishedSize itm)
 {
     bool returnValue = false;
     SQLWrapper sw = new SQLWrapper();
     sw.BeginTransaction();
     try
     {
         UpdateOrderFinishedSizes(orderID, itm, ref sw);
         sw.CommitTransaction();
         returnValue = true;
     }
     catch
     {
         sw.RollBackTransaction();
     }
     finally
     {
         sw = null;
     }
     return returnValue;
 }