當前位置: 首頁>>代碼示例>>C#>>正文


C# DatabaseHelper.BeginTransaction方法代碼示例

本文整理匯總了C#中POS.DataLayer.DatabaseHelper.BeginTransaction方法的典型用法代碼示例。如果您正苦於以下問題:C# DatabaseHelper.BeginTransaction方法的具體用法?C# DatabaseHelper.BeginTransaction怎麽用?C# DatabaseHelper.BeginTransaction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在POS.DataLayer.DatabaseHelper的用法示例。


在下文中一共展示了DatabaseHelper.BeginTransaction方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: 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

示例3: 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

示例4: UpdateTransaction

 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;
 }
開發者ID:kimboox44,項目名稱:POS,代碼行數:31,代碼來源:PURPurchaseReturnLine.cs

示例5: 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

示例6: 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

示例7: SaveAndCommitTransaction

 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;
 }
開發者ID:kimboox44,項目名稱:POS,代碼行數:25,代碼來源:INVTransferLine.cs

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例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.BeginTransaction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。