public DataTable QueryRouteLineByALL()
 {
     try
     {
         DBO.STM_RouteLineDBO dbo = new STM_RouteLineDBO(ref USEDB);
         return dbo.doQueryAll();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public DataTable QuerySwitch(QueryType QT,
                                     ArrayList ParameterList
                                     )
        {
            DBO.STM_RouteLineDBO dbo = new STM_RouteLineDBO(ref USEDB);
            DataTable Dt;

            try
            {
                switch (QT)
                {
                    case QueryType.ALL:
                        Dt = dbo.doQueryAll();
                        break;
                    case QueryType.CODE:
                        Dt = new DataTable();
                        break;
                    case QueryType.ID:
                        Dt = dbo.doQueryByID(ParameterList);
                        break;
                    case QueryType.Scode:
                        Dt = dbo.doQueryByScode(ParameterList);
                        break;
                    case QueryType.Custom:
                        Dt = dbo.doQueryByFind(ParameterList);
                        break;
                    default:
                        Dt = new DataTable();
                        break;
                }

                return Dt;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public DataTable QueryRouteLineByPK(ArrayList ParameterList)
 {
     try
     {
         DBO.STM_RouteLineDBO dbo = new STM_RouteLineDBO(ref USEDB);
         return dbo.doQueryByPk(ParameterList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 在生效中的路線,應不可存在同樣的門市資料
 /// </summary>
 /// <param name="ParameterList">放入變數</param>
 /// <returns>回傳查詢結果</returns>
 public DataTable CheckDupStore(ArrayList ParameterList)
 {
     try
     {
         DBO.STM_RouteLineDBO dbo = new STM_RouteLineDBO(ref USEDB);
         return dbo.doQurtyDupStore(ParameterList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #5
0
        /// <summary>
        /// 基本表單更新BCO
        /// </summary>
        /// <param name="DetailData">更新變數</param>
        /// <param name="RootDBT">是否有主交易,無主交易輸入null</param>
        /// <returns>回傳成功與否</returns>
        ///  
       
        public bool UpdateDetail(Int32 PID, ArrayList ParameterList, DataRow dRow, DataRow dRow_Oringinal, DbTransaction RootDBT)
        {
            bool IsRootTranscation = false;
            bool bResult = false;
            try
            {
                STM_RouteLineDBO LineDBO = new STM_RouteLineDBO(ref USEDB);

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


                #region 啟動交易或指定RootTranscation

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

                #endregion

                LineDBO.doUpdate(PID, ParameterList, dRow, dRow_Oringinal, DBT);


                #region 交易成功

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

                #endregion

                bResult = true;

                return bResult;
            }
            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

            }
        }
Example #6
0
        /// <summary>
        /// 基本表單刪除BCO
        /// </summary>
        /// <param name="RootDBT">是否有主交易,無主交易輸入null</param>
        /// <returns>回傳成功與否</returns>
        ///  

        public bool DeleteDetailOne(string ROUTE, string EFF_START, string CHAN_NO, string STORE, string UID, DbTransaction RootDBT)
        {
            bool IsRootTranscation = false;
            bool bResult = false;
            try
            {
                STM_RouteLineDBO LineDBO = new STM_RouteLineDBO(ref USEDB);


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


                #region 啟動交易或指定RootTranscation

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

                #endregion

                LineDBO.doDeleteOne(ROUTE, EFF_START, CHAN_NO, STORE, UID, DBT);


                #region 交易成功

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

                #endregion

                bResult = true;

                return bResult;
            }
            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

            }
        }