/// <summary>
 /// CAA031,BUTTON [儲存]鈕,取得 VDS_CAA_DISC_MAIN SCHEMA
 /// </summary>
 /// <param name="ParameterList"></param>
 /// <returns></returns>
 public DataTable GET_VDS_CAA_DISC_MAIN_SCHEMA_3(ArrayList ParameterList)
 {
     try
     {
         CAA_03DBO CAA03 = new CAA_03DBO(ref USEDB);
         return CAA03.GET_VDS_CAA_DISC_MAIN_SCHEMA_3(ParameterList);
     }
     catch (Exception ex)
     { throw ex; }
 }
 /// <summary>
 /// CAA031, 根據使用者輸入條件,查詢報表相關資料
 /// </summary>
 /// <param name="ParameterList"></param>
 /// <returns>回傳查詢結果</returns>
 public DataTable QueryPeriodByFind(ArrayList ParameterList)
 {
     try
     {
         CAA_03DBO CAA03 = new CAA_03DBO(ref USEDB);
         return CAA03.QueryPeriodByFind(ParameterList);
     }
     catch (Exception ex)
     { throw ex; }
 }
        /// <summary>
        /// CAA031,按下 Button [確定申報]鈕
        /// </summary>
        /// <param name="RootDBT"></param>
        /// <param name="dt_Update_Disc">異動的資料</param>
        public void UpdatePeriodFlagOk(DbTransaction RootDBT, DataTable dt_Update_Disc)
        {
            bool IsRootTranscation = false;

            try
            {
                //判斷是否有傳入Root Transcation 
                IsRootTranscation = (RootDBT == null) ? true : false;

                #region 啟動交易或指定RootTranscation

                if (IsRootTranscation)
                {
                    //獨立呼叫啟動Transcation
                    Conn = USEDB.CreateConnection();
                    Conn.Open();
                    DBT = Conn.BeginTransaction();
                }
                else
                {
                    DBT = RootDBT;
                }

                #endregion

                #region 設定變數

                CAA_03DBO CAA03 = new CAA_03DBO(ref USEDB);

                #endregion

                #region 修改 VDS_CAA_DISC_MAIN 資料

                foreach (DataRow drRow in dt_Update_Disc.Rows)
                { CAA03.UpdatePeriodFlagOk(DBT, drRow); }

                #endregion

                #region 交易成功

                if (IsRootTranscation)
                {
                    //獨立呼叫Transcation成立
                    DBT.Commit();
                }

                #endregion
            }
            catch (Exception ex)
            {
                #region 交易失敗

                if (IsRootTranscation)
                {
                    //獨立呼叫Transcation失敗
                    DBT.Rollback();
                }

                #endregion

                throw ex;
            }
            finally
            {
                #region 判斷是否關閉交易連線

                if (IsRootTranscation)
                {
                    //獨立呼叫Transcation,關閉連線
                    if (Conn.State == ConnectionState.Connecting)
                    {
                        Conn.Close();
                    }
                }

                #endregion
            }
        }