public bool SaveAccountUpdates(SALSalesHeader salesHeader, BDCustomerAccount customerAccount) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); ExecutionState = UpdateCustomerAccount(oDatabaseHelper, customerAccount, ExecutionState); if (!UpdateSalesHeader(oDatabaseHelper, salesHeader)) { ExecutionState = false; } else { ExecutionState = true; } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } oDatabaseHelper.Dispose(); return(ExecutionState); }
public bool SaveAndCommitTransaction(INVTransferHeader transferHeader, INVTransferLineCollection transferLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; int transferHeaderID; oDatabaseHelper.BeginTransaction(); if (InsertHeader(oDatabaseHelper, transferHeader, out transferHeaderID)) { foreach (INVTransferLine transferLine in transferLineCollection) { if (!InsertDetailsAndCommit(oDatabaseHelper, transferLine, transferHeaderID)) { ExecutionState = false; break; } else { ExecutionState = true; } } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } } return(ExecutionState); }
public bool DeleteTransaction(int ProductStockID, INVAdjustStockCollection ajustStockCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (DeleteAdjustStock(oDatabaseHelper, ProductStockID)) { foreach (INVAdjustStock adjustStock in ajustStockCollection) { if (!InsertDetailsAndCommit(oDatabaseHelper, adjustStock)) { ExecutionState = false; break; } else { ExecutionState = true; } } } else { ExecutionState = false; } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } return(ExecutionState); }
public int SaveTransaction(SALSalesHeader sALSalesHeader, SALSalesLineCollection sALSalesLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; int salesHeaderID = -1; oDatabaseHelper.BeginTransaction(); if (InsertHeader(oDatabaseHelper, sALSalesHeader, out salesHeaderID)) { foreach (SALSalesLine sALSalesLine in sALSalesLineCollection) { if (!InsertDetails(oDatabaseHelper, sALSalesLine, salesHeaderID)) { ExecutionState = false; break; } else { ExecutionState = true; } } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } } return(salesHeaderID); }
public static bool InsertGroupRoles(ADGroupRoleCollection aDGroupRoleCollection, int groupID) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (Deletelines(oDatabaseHelper, groupID)) { foreach (ADGroupRole groupRole in aDGroupRoleCollection) { if (!InsertDetails(oDatabaseHelper, groupRole)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); } else ExecutionState = false; oDatabaseHelper.Dispose(); return ExecutionState; }
public bool DeleteTransaction(int ProductStockID,INVAdjustStockCollection ajustStockCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (DeleteAdjustStock(oDatabaseHelper,ProductStockID)) { foreach (INVAdjustStock adjustStock in ajustStockCollection) { if (!InsertDetailsAndCommit(oDatabaseHelper, adjustStock)) { ExecutionState = false; break; } else ExecutionState = true; } } else ExecutionState = false; if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); return ExecutionState; }
public int SaveTransaction(PURPurchaseReturnHeader pURPurchaseReturnHeader, PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; int salesReturnHeaderID = -1; oDatabaseHelper.BeginTransaction(); if (InsertHeader(oDatabaseHelper, pURPurchaseReturnHeader, out salesReturnHeaderID)) { foreach (PURPurchaseReturnLine pURPurchaseLine in pURPurchaseReturnLineCollection) { if (!InsertDetails(oDatabaseHelper, pURPurchaseLine, salesReturnHeaderID)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); } return salesReturnHeaderID; }
public bool UpdateTransaction(PURPurchaseReturnHeader pURPurchaseReturnHeader, PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (UpdateHeader(oDatabaseHelper, pURPurchaseReturnHeader)) { if (DeleteDetails(oDatabaseHelper, (int)pURPurchaseReturnHeader.PurchaseReturnID, (int)pURPurchaseReturnHeader.UpdatedBy)) { foreach (PURPurchaseReturnLine pURPurchaseReturnLine in pURPurchaseReturnLineCollection) { if (!InsertDetails(oDatabaseHelper, pURPurchaseReturnLine, (int)pURPurchaseReturnHeader.PurchaseReturnID)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); } else ExecutionState = false; } else ExecutionState = false; return ExecutionState; }
public bool SaveAndCommitTransaction(INVTransferHeader transferHeader, INVTransferLineCollection transferLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; int transferHeaderID; oDatabaseHelper.BeginTransaction(); if (InsertHeader(oDatabaseHelper, transferHeader, out transferHeaderID)) { foreach (INVTransferLine transferLine in transferLineCollection) { if (!InsertDetailsAndCommit(oDatabaseHelper, transferLine, transferHeaderID)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); } return ExecutionState; }
public int SaveTransaction(SALSalesReturnHeader sALSalesReturnHeader, SALSalesReturnLineCollection sALSalesReturnLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; int salesReturnHeaderID = -1; oDatabaseHelper.BeginTransaction(); if (InsertHeader(oDatabaseHelper, sALSalesReturnHeader, out salesReturnHeaderID)) { foreach (SALSalesReturnLine sALSalesLine in sALSalesReturnLineCollection) { if (!InsertDetails(oDatabaseHelper, sALSalesLine, salesReturnHeaderID)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); salesReturnHeaderID = -1; } } oDatabaseHelper.Dispose(); return salesReturnHeaderID; }
public bool SaveAccountUpdates(PURPurchaseHeader purchaseHeader, BDSupplierAccount supplierAccount) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); ExecutionState = UpdateSupplierAccount(oDatabaseHelper, supplierAccount, ExecutionState); if (!UpdatePurchaseHeader(oDatabaseHelper, purchaseHeader)) { ExecutionState = false; } else { ExecutionState = true; } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } oDatabaseHelper.Dispose(); return(ExecutionState); }
public int SaveTransaction(PURPurchaseReturnHeader pURPurchaseReturnHeader, PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; int salesReturnHeaderID = -1; oDatabaseHelper.BeginTransaction(); if (InsertHeader(oDatabaseHelper, pURPurchaseReturnHeader, out salesReturnHeaderID)) { foreach (PURPurchaseReturnLine pURPurchaseLine in pURPurchaseReturnLineCollection) { if (!InsertDetails(oDatabaseHelper, pURPurchaseLine, salesReturnHeaderID)) { ExecutionState = false; break; } else { ExecutionState = true; } } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } } return(salesReturnHeaderID); }
public bool UpdateTransaction(SALSalesReturnHeader sALSalesReturnHeader, SALSalesReturnLineCollection sALSalesReturnLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (UpdateHeader(oDatabaseHelper, sALSalesReturnHeader)) { if (DeleteDetails(oDatabaseHelper, (int)sALSalesReturnHeader.SlaesReturnHeaderID, (int)sALSalesReturnHeader.UpdatedBy)) { foreach (SALSalesReturnLine sALSalesReturnLine in sALSalesReturnLineCollection) { if (!InsertDetails(oDatabaseHelper, sALSalesReturnLine, (int)sALSalesReturnHeader.SlaesReturnHeaderID)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); } else ExecutionState = false; } else ExecutionState = false; oDatabaseHelper.Dispose(); return ExecutionState; }
public bool CloseOrder(int INVTransferHeaderID, int UserID, INVTransferLineCollection transferLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); oDatabaseHelper.AddParameter("@UserID", UserID); oDatabaseHelper.AddParameter("@INVTransferHeaderID", INVTransferHeaderID); oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output); oDatabaseHelper.ExecuteScalar("usp_INVTransferHader_CloseOrder", CommandType.StoredProcedure, ConnectionState.KeepOpen, ref ExecutionState); if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); oDatabaseHelper.Dispose(); return ExecutionState; }
public bool UpdateTransaction(SALSalesReturnHeader sALSalesReturnHeader, SALSalesReturnLineCollection sALSalesReturnLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (UpdateHeader(oDatabaseHelper, sALSalesReturnHeader)) { if (DeleteDetails(oDatabaseHelper, (int)sALSalesReturnHeader.SlaesReturnHeaderID, (int)sALSalesReturnHeader.UpdatedBy)) { foreach (SALSalesReturnLine sALSalesReturnLine in sALSalesReturnLineCollection) { if (!InsertDetails(oDatabaseHelper, sALSalesReturnLine, (int)sALSalesReturnHeader.SlaesReturnHeaderID)) { ExecutionState = false; break; } else { ExecutionState = true; } } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } } else { ExecutionState = false; } } else { ExecutionState = false; } oDatabaseHelper.Dispose(); return(ExecutionState); }
public bool SaveAccountUpdates(SALSalesHeader salesHeader, BDCustomerAccount customerAccount) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); ExecutionState = UpdateCustomerAccount(oDatabaseHelper, customerAccount, ExecutionState); if (!UpdateSalesHeader(oDatabaseHelper, salesHeader)) { ExecutionState = false; } else ExecutionState = true; if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); oDatabaseHelper.Dispose(); return ExecutionState; }
public bool SaveAccountUpdates(PURPurchaseHeader purchaseHeader, BDSupplierAccount supplierAccount) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); ExecutionState = UpdateSupplierAccount(oDatabaseHelper, supplierAccount, ExecutionState); if (!UpdatePurchaseHeader(oDatabaseHelper, purchaseHeader)) { ExecutionState = false; } else ExecutionState = true; if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); oDatabaseHelper.Dispose(); return ExecutionState; }
public bool UpdateTransaction(INVTransferHeader transferHeader, INVTransferLineCollection transferLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (UpdateHeader(oDatabaseHelper, transferHeader)) { if (DeleteDetails(oDatabaseHelper, (int)transferHeader.INVTransferHeaderID, (int)transferHeader.CreatedBy)) { foreach (INVTransferLine transferLine in transferLineCollection) { if (!InsertDetailsAndCommit(oDatabaseHelper, transferLine, (int)transferHeader.INVTransferHeaderID)) { ExecutionState = false; break; } else { ExecutionState = true; } } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } } else { ExecutionState = false; } } else { ExecutionState = false; } return(ExecutionState); }
public bool UpdateTransaction(PURPurchaseReturnHeader pURPurchaseReturnHeader, PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (UpdateHeader(oDatabaseHelper, pURPurchaseReturnHeader)) { if (DeleteDetails(oDatabaseHelper, (int)pURPurchaseReturnHeader.PurchaseReturnID, (int)pURPurchaseReturnHeader.UpdatedBy)) { foreach (PURPurchaseReturnLine pURPurchaseReturnLine in pURPurchaseReturnLineCollection) { if (!InsertDetails(oDatabaseHelper, pURPurchaseReturnLine, (int)pURPurchaseReturnHeader.PurchaseReturnID)) { ExecutionState = false; break; } else { ExecutionState = true; } } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } } else { ExecutionState = false; } } else { ExecutionState = false; } return(ExecutionState); }
public bool CloseOrder(int INVTransferHeaderID, int UserID, INVTransferLineCollection transferLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); oDatabaseHelper.AddParameter("@UserID", UserID); oDatabaseHelper.AddParameter("@INVTransferHeaderID", INVTransferHeaderID); oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output); oDatabaseHelper.ExecuteScalar("usp_INVTransferHader_CloseOrder", CommandType.StoredProcedure, ConnectionState.KeepOpen, ref ExecutionState); if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } oDatabaseHelper.Dispose(); return(ExecutionState); }
public bool SaveTransaction(INVAdjustStockCollection ajustStockCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); foreach (INVAdjustStock adjustStock in ajustStockCollection) { if (!InsertDetailsAndCommit(oDatabaseHelper, adjustStock)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); return ExecutionState; }
public static bool InsertGroupRoles(ADGroupRoleCollection aDGroupRoleCollection, int groupID) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (Deletelines(oDatabaseHelper, groupID)) { foreach (ADGroupRole groupRole in aDGroupRoleCollection) { if (!InsertDetails(oDatabaseHelper, groupRole)) { ExecutionState = false; break; } else { ExecutionState = true; } } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } } else { ExecutionState = false; } oDatabaseHelper.Dispose(); return(ExecutionState); }
public bool UpdateTransaction(INVTransferHeader transferHeader, INVTransferLineCollection transferLineCollection) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (UpdateHeader(oDatabaseHelper, transferHeader)) { if (DeleteDetails(oDatabaseHelper, (int)transferHeader.INVTransferHeaderID, (int)transferHeader.CreatedBy)) { foreach (INVTransferLine transferLine in transferLineCollection) { if (!InsertDetailsAndCommit(oDatabaseHelper, transferLine, (int)transferHeader.INVTransferHeaderID)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); } else ExecutionState = false; } else ExecutionState = false; return ExecutionState; }