Example #1
0
 public static bool UpdateOrderFinishedSizes(Guid orderID, OrderFinishedSize itm, ref SQLWrapper sw)
 {
     bool returnValue = false;
     SqlParameter[] param =
     {
         new SqlParameter("OrderID",typeof(Guid))
     };
     param[0].Value = orderID;
     sw.ExecuteStoredProcedureInTransaction("ORD_DeleteOrderFinishedSizes", param);
     if (itm.OrderFSJacketSize != null)
     {
         for (int i = 0; i <= itm.OrderFSJacketSize.Count - 1; i++)
         {
             param = prepareParams(orderID, 4, itm.OrderFSJacketSize[i]);
             sw.ExecuteStoredProcedureInTransaction("ORD_AddOrderSize", param);
         }
     }
     if (itm.OrderFSSlackVestTopCoatSize != null)
     {
         for (int i = 0; i <= itm.OrderFSSlackVestTopCoatSize.Count - 1; i++)
         {
             param = prepareParams(orderID, 5, itm.OrderFSSlackVestTopCoatSize[i]);
             sw.ExecuteStoredProcedureInTransaction("ORD_AddOrderSize", param);
         }
     }
     if (itm.OrderFSShirtSize != null)
     {
         for (int i = 0; i <= itm.OrderFSShirtSize.Count - 1; i++)
         {
             param = prepareParams(orderID, 6, itm.OrderFSShirtSize[i]);
             sw.ExecuteStoredProcedureInTransaction("ORD_AddOrderSize", param);
         }
     }
     return returnValue;
 }
Example #2
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;
 }
Example #3
0
 private static OrderFinishedSize loadOrderFinishedSize(DataTable dtFS)
 {
     OrderFinishedSize fs = new OrderFinishedSize();
     fs.OrderFSJacketSize = getOrderSizes(dtFS, Convert.ToInt32(TypeOfSizes.OrderFinishedJacketSize));
     fs.OrderFSShirtSize = getOrderSizes(dtFS, Convert.ToInt32(TypeOfSizes.OrderFinishedShirtSize));
     fs.OrderFSSlackVestTopCoatSize = getOrderSizes(dtFS, Convert.ToInt32(TypeOfSizes.OrderFinishedSlackVestTopCoatSize));
     return fs;
 }