public void Unsuspense()
        {
            // The equivalent try/catch block that is used for Suspense() was removed 27 Jan 2015 in order to fix
            //  the issue in Mantis #3730
            OdbcParameter[] ParametersArray;
            ParametersArray          = new OdbcParameter[2];
            ParametersArray[0]       = new OdbcParameter("", OdbcType.Int);
            ParametersArray[0].Value = ledgerNumber;
            ParametersArray[1]       = new OdbcParameter("", OdbcType.VarChar);
            ParametersArray[1].Value = strAcount;

            TDBTransaction transaction  = new TDBTransaction();
            TDataBase      db           = DBAccess.Connect("Unsuspense");
            bool           SubmissionOK = true;

            db.WriteTransaction(ref transaction, ref SubmissionOK,
                                delegate
            {
                string strSQL = "DELETE FROM PUB_" + ASuspenseAccountTable.GetTableDBName() + " ";
                strSQL       += "WHERE " + ASuspenseAccountTable.GetLedgerNumberDBName() + " = ? ";
                strSQL       += "AND " + ASuspenseAccountTable.GetSuspenseAccountCodeDBName() + " = ? ";

                db.ExecuteNonQuery(strSQL, transaction, ParametersArray);
            });
        }
예제 #2
0
        public void Suspense()
        {
            try
            {
                OdbcParameter[] ParametersArray;
                ParametersArray          = new OdbcParameter[2];
                ParametersArray[0]       = new OdbcParameter("", OdbcType.Int);
                ParametersArray[0].Value = ledgerNumber;
                ParametersArray[1]       = new OdbcParameter("", OdbcType.VarChar);
                ParametersArray[1].Value = strAcount;

                TDBTransaction transaction  = null;
                bool           SubmissionOK = true;
                DBAccess.GDBAccessObj.BeginAutoTransaction(ref transaction, ref SubmissionOK,
                                                           delegate
                {
                    string strSQL = "INSERT INTO PUB_" + ASuspenseAccountTable.GetTableDBName() + " ";
                    strSQL       += "(" + ASuspenseAccountTable.GetLedgerNumberDBName();
                    strSQL       += "," + ASuspenseAccountTable.GetSuspenseAccountCodeDBName() + ") ";
                    strSQL       += "VALUES ( ? , ? )";

                    DBAccess.GDBAccessObj.ExecuteNonQuery(strSQL, transaction, ParametersArray);
                });
            }
            catch (Exception)
            {
                Assert.Fail("No database access to run the test");
            }
        }
예제 #3
0
        public void Unsuspense()
        {
            try
            {
                OdbcParameter[] ParametersArray;
                ParametersArray          = new OdbcParameter[2];
                ParametersArray[0]       = new OdbcParameter("", OdbcType.Int);
                ParametersArray[0].Value = ledgerNumber;
                ParametersArray[1]       = new OdbcParameter("", OdbcType.VarChar);
                ParametersArray[1].Value = strAcount;

                TDBTransaction transaction = DBAccess.GDBAccessObj.BeginTransaction();
                string         strSQL      = "DELETE FROM PUB_" + ASuspenseAccountTable.GetTableDBName() + " ";
                strSQL += "WHERE " + ASuspenseAccountTable.GetLedgerNumberDBName() + " = ? ";
                strSQL += "AND " + ASuspenseAccountTable.GetSuspenseAccountCodeDBName() + " = ? ";

                DBAccess.GDBAccessObj.ExecuteNonQuery(strSQL, transaction, ParametersArray);
                DBAccess.GDBAccessObj.CommitTransaction();
            }
            catch (Exception)
            {
                Assert.Fail("No database access to run the test");
            }
        }