Exemplo n.º 1
0
        public bool QueryNowCheckOutLog(ArrayList ParameterList, out int intID, out DateTime dtFreeze_Date, out DateTime dtCheckout_Date)
        {
            VDS_IVM01_DBO dbo = new VDS_IVM01_DBO(ref USEDB);

            try
            {
                return dbo.QueryNowCheckOutLog(ParameterList, out intID, out dtFreeze_Date, out dtCheckout_Date);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public void QueryLastCheckOutLog(out string strNow_Acct_Mon, out string strAcct_Mon,
            out DateTime dtFreeze_Date, out DateTime dtUnfreeze_Date, out DateTime dtCheckout_Date)
        {
            VDS_IVM01_DBO dbo = new VDS_IVM01_DBO(ref USEDB);

            try
            {
                dbo.QueryLastCheckOutLog(out strNow_Acct_Mon, out strAcct_Mon, out dtFreeze_Date, out dtUnfreeze_Date, out dtCheckout_Date);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public void CreateCheckOutLog(ArrayList parameterList, DbTransaction RootDBT, out int intID)
        {
            bool IsRootTranscation = false;

            DBO.VDS_IVM01_DBO IVMM = new VDS_IVM01_DBO(ref USEDB);

            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

                IVMM.CreateCheckOutLog(parameterList, DBT, out intID);

                #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

            }
        }