Example #1
0
 /// <summary>
 /// CAA32,[檢視][編輯]模式,畫面Load資料
 /// </summary>
 /// <param name="ParameterList"></param>
 /// <returns></returns>
 public DataTable QUERY_CAA332_INVOICE(ArrayList ParameterList)
 {
     try
     {
         CAA_33DBO CAA33 = new CAA_33DBO(ref USEDB);
         return CAA33.QUERY_CAA332_INVOICE(ParameterList);
     }
     catch (Exception ex)
     { throw ex; }
 }
Example #2
0
        /// <summary>
        /// CAA32,[編輯]模式,按下[儲存]鈕
        /// </summary>
        /// <param name="RootDBT"></param>
        /// <param name="ParameterList"></param>
        /// <returns></returns>
        public void UPDATE_CAA332_INVOICE(DbTransaction RootDBT, ArrayList ParameterList)
        {
            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_33DBO CAA33 = new CAA_33DBO(ref USEDB);

                #endregion

                #region 更新 VDS_CAA_INV_MAIN 資料

                CAA33.UPDATE_CAA332_INVOICE(DBT, ParameterList);

                #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
            }
        }