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; }
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; }
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; }
public static bool AddOrderMaterial(Guid orderID, OrderMaterialItem itm, ref SQLWrapper sw) { bool returnValue = false; SqlParameter[] param = prepareParams(orderID, itm); returnValue = sw.ExecuteStoredProcedureInTransaction("ORD_AddUpdateOrderMaterial",param); return returnValue; }
public static bool DeleteRestOfTheOrderPayments(Guid orderID, string otherThanSequenceNumbers, ref SQLWrapper sw) { SqlParameter[] param = { new SqlParameter("OrderID",typeof(Guid )), new SqlParameter("Sequences",typeof(string )), }; param[0].Value = orderID; param[1].Value = otherThanSequenceNumbers; return sw.ExecuteStoredProcedureInTransaction("ORD_DeleteOrderPayments", param); }
public static bool AddUpdateOrderPayment(Guid orderID, IOrderPaymentItem paymentItem,ref SQLWrapper sw) { SqlParameter[] param = prepareParameters(orderID,paymentItem); return sw.ExecuteStoredProcedureInTransaction("ORD_AddUpdateOrderPayment", param); }