Exemple #1
0
        public DataTable QueryByLike(ArrayList ParameterList)
        {
            try
            {
                STM_STM35_DBO DBO = new STM_STM35_DBO(ref USEDB);
                DataTable dt = DBO.QueryITEM(ParameterList);
                return dt;
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }
Exemple #2
0
        public DataTable QueryDataPrice_SG(ArrayList ParameterList)
        {
            try
            {
                STM_STM35_DBO DBO = new STM_STM35_DBO(ref USEDB);

                DataTable ds_Return = new DataTable();

                ds_Return = DBO.QUERYDATABYVIEW_PRICE_SG(ParameterList);

                return ds_Return;
            }
            catch (Exception ex)
            { throw ex; }
        }
Exemple #3
0
        public ArrayList QueryContract(string VENDOR)
        {
            try
            {
                STM_STM35_DBO DBO = new STM_STM35_DBO(ref USEDB);
                ArrayList arl_Return = DBO.QueryContract(VENDOR);
                return arl_Return;
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }
Exemple #4
0
        public string UpdateComfirmPrice_SG(ArrayList arl, DbTransaction RootDBT)
        {
            bool IsRootTranscation = false;
            try
            {
                DBO.STM_STM35_DBO dbo = new STM_STM35_DBO(ref USEDB);
                string strResault = string.Empty;

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

                #region 啟動交易或指定RootTranscation

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

                #endregion

                strResault = dbo.UpdateComfirmPrice_SG(arl, DBT);


                #region 交易成功

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

                return strResault;

            }
            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

            }
        }