当前位置: 首页>>代码示例>>C#>>正文


C# DatabaseHelper.RollbackTransaction方法代码示例

本文整理汇总了C#中POS.DataLayer.DatabaseHelper.RollbackTransaction方法的典型用法代码示例。如果您正苦于以下问题:C# DatabaseHelper.RollbackTransaction方法的具体用法?C# DatabaseHelper.RollbackTransaction怎么用?C# DatabaseHelper.RollbackTransaction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在POS.DataLayer.DatabaseHelper的用法示例。


在下文中一共展示了DatabaseHelper.RollbackTransaction方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InsertGroupRoles

        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;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:32,代码来源:ADGroupRole.cs

示例2: SaveTransaction

 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:31,代码来源:SALSalesReturnLine.cs

示例3: SaveTransaction

 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:25,代码来源:PURPurchaseReturnLine.cs

示例4: SaveTransaction

 public bool SaveTransaction(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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:25,代码来源:INVTransferLine.cs

示例5: CloseOrder

 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:16,代码来源:INVTransferHeader.cs

示例6: SaveAccountUpdates

 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:19,代码来源:BDSupplierAccount.cs

示例7: SaveAccountUpdates

 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:19,代码来源:BDCustomerAccount.cs

示例8: SaveTransaction

        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;
        }
开发者ID:kimboox44,项目名称:POS,代码行数:22,代码来源:INVAdjustStock.cs

示例9: UpdateTransaction

 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:32,代码来源:SALSalesReturnLine.cs

示例10: UpdateTransaction

 public bool UpdateTransaction(PURPurchaseHeader pURPurchaseHeader, PURPurchaseLineCollection sALPurchaseLineCollection)
 {
     oDatabaseHelper = new DatabaseHelper();
     bool ExecutionState = false;
     oDatabaseHelper.BeginTransaction();
     if (UpdateHeader(oDatabaseHelper, pURPurchaseHeader))
     {
         if (DeleteDetails(oDatabaseHelper, (int)pURPurchaseHeader.PurcaseHeaderID, (int)pURPurchaseHeader.CreatedBy))
         {
             foreach (PURPurchaseLine sALPurchaseLine in sALPurchaseLineCollection)
             {
                 if (!InsertDetails(oDatabaseHelper, sALPurchaseLine, (int)pURPurchaseHeader.PurcaseHeaderID))
                 {
                     ExecutionState = false;
                     break;
                 }
                 else
                     ExecutionState = true;
             }
             if (ExecutionState)
                 oDatabaseHelper.CommitTransaction();
             else
                 oDatabaseHelper.RollbackTransaction();
         }
         else
             ExecutionState = false;
     }
     else
         ExecutionState = false;
     return ExecutionState;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:31,代码来源:PURPurchaseLine.cs

示例11: DeleteTransaction

        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;
        }
开发者ID:kimboox44,项目名称:POS,代码行数:28,代码来源:INVAdjustStock.cs

示例12: UpdateTransaction

 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:31,代码来源:INVTransferLine.cs


注:本文中的POS.DataLayer.DatabaseHelper.RollbackTransaction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。