コード例 #1
0
ファイル: ADGroupRole.cs プロジェクト: kimboox44/POS
        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;

        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: BDCustomerAccount.cs プロジェクト: taiab/POS
        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);
        }
コード例 #5
0
 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;
 }
コード例 #6
0
ファイル: PURPurchaseReturnLine.cs プロジェクト: taiab/POS
        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);
        }
コード例 #7
0
ファイル: INVTransferLine.cs プロジェクト: kimboox44/POS
 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;
 }
コード例 #8
0
ファイル: SALSalesReturnLine.cs プロジェクト: kimboox44/POS
 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;
 }
コード例 #9
0
        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);
        }
コード例 #10
0
ファイル: INVTransferLine.cs プロジェクト: taiab/POS
        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);
        }
コード例 #11
0
ファイル: INVTransferHeader.cs プロジェクト: kimboox44/POS
 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;
 }
コード例 #12
0
        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);
        }
コード例 #13
0
ファイル: BDSupplierAccount.cs プロジェクト: kimboox44/POS
 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;
 }
コード例 #14
0
ファイル: BDCustomerAccount.cs プロジェクト: kimboox44/POS
 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;
 }
コード例 #15
0
ファイル: PURPurchaseReturnLine.cs プロジェクト: taiab/POS
        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);
        }
コード例 #16
0
ファイル: INVTransferLine.cs プロジェクト: taiab/POS
        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);
        }
コード例 #17
0
ファイル: INVTransferHeader.cs プロジェクト: taiab/POS
        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);
        }
コード例 #18
0
ファイル: INVAdjustStock.cs プロジェクト: kimboox44/POS
        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;
        }
コード例 #19
0
        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);
        }
コード例 #20
0
ファイル: SALSalesReturnLine.cs プロジェクト: kimboox44/POS
 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;
 }
コード例 #21
0
ファイル: INVAdjustStock.cs プロジェクト: kimboox44/POS
        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;
        }
コード例 #22
0
ファイル: INVTransferLine.cs プロジェクト: kimboox44/POS
 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;
 }
コード例 #23
0
ファイル: PURPurchaseLine.cs プロジェクト: kimboox44/POS
 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;
 }