Exemple #1
0
        public void DELETE_AND_INSERT_TEMP_TABLE(ArrayList ParameterList, DataTable dtTMP)
        {
            try
            {
                DBO.PUR09_DBO DBO = new PUR09_DBO(ref USEDB);
                //獨立呼叫啟動Transcation
                Conn = USEDB.CreateConnection();
                Conn.Open();
                DbTransaction DBT = Conn.BeginTransaction();

                DBO.doDel_TMP(ParameterList, DBT);

                foreach (DataRow dRow in dtTMP.Rows)
                {
                    DBO.doAdd_TMP(dRow, DBT);
                }

                DBT.Commit();
            }
            catch (Exception ex)
            {
                if (DBT != null)
                    DBT.Rollback();
                throw ex;
            }
            finally
            {
                if (Conn.State == ConnectionState.Connecting)
                    Conn.Close();
            }
        }