Exemplo n.º 1
0
        public DataTable QuerySwitch(QueryType QT, ArrayList ParameterList)
        {
            DBO.VDS_CRM_MESSAGEDBO VCM = new VDS_CRM_MESSAGEDBO(ref USEDB);
            
            DataTable Dt;

            try
            {
                switch (QT)
                {
                    case QueryType.QueryCRMMessageByFind:
                        Dt = VCM.DO_CRM011_QUERY_MESSAGE(ParameterList);
                        break;
                    default:
                        Dt = new DataTable();
                        break;
                }

                return Dt;
            }
            catch (Exception ex)
            {
                throw GetNewException(ex);
            }
        }
Exemplo n.º 2
0
        public void DeletCRMMessage(ArrayList ParameterList, DbTransaction RootDBT)
        {
            string s_Log_UpdateUid = string.Empty;
            DateTime d_Log_UpdateDate;
            bool IsRootTranscation = false;

            try
            {
                DBO.VDS_CRM_MESSAGEDBO VCM = new VDS_CRM_MESSAGEDBO(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

                VCM.DELETE_CRM011_MESSAGE(ParameterList, DBT);

                #region 交易成功

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

                #endregion

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

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

                #endregion

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

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

                #endregion
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 新增 VDS_CRM_MESSAGE
        /// </summary>
        /// <param name="ParameterList"></param>
        /// <param name="RootDBT"></param>
        public void CreateCRMMessage(ArrayList ParameterList, DbTransaction RootDBT,DataTable dt_Message)
        {
            bool IsRootTranscation = false;

            try
            {
                DBO.VDS_CRM_MESSAGEDBO VCM = new VDS_CRM_MESSAGEDBO(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

                foreach (DataRow dRow in dt_Message.Rows)
                {
                    VCM.ADD_CRM01A_MESSAGE(ParameterList, DBT, dRow);
                }

                #region 交易成功

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

                #endregion

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

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

                #endregion

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

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

                #endregion
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 查詢 VDS_CRM_MESSAGE 的資料
        /// </summary>
        /// <param name="ParameterList">VDS_CRM_MESSAGE.CODE</param>
        /// <returns>VDS_CRM_MESSAGE 的資料</returns>
        public DataTable QueryCRMRecordByCode(ArrayList ParameterList)
        {
            try
            {
                DataTable dt_Return = new DataTable();

                DBO.VDS_CRM_MESSAGEDBO VCM = new VDS_CRM_MESSAGEDBO(ref USEDB);
                dt_Return = VCM.QUERY_CRM01A_MESSAGE_BY_CODE(ParameterList);
                dt_Return.TableName = "VDS_CRM_MESSAGE";

                return dt_Return;
            }
            catch (Exception ex)
            {
                throw GetNewException(ex);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 取得 VDS_CRM_MESSAGE 的 SCHEMA
        /// </summary>
        /// <param name="ParameterList"></param>
        /// <returns>回傳查詢結果</returns>
        public DataTable GET_VDS_CRM_MESSAGE_SCHEMA(ArrayList ParameterList)
        {
            try
            {
                DBO.VDS_CRM_MESSAGEDBO VCM = new VDS_CRM_MESSAGEDBO(ref USEDB);

                return VCM.GET_VDS_CRM_MESSAGE_SCHEMA(ParameterList);
            }
            catch (Exception ex)
            {
                throw GetNewException(ex);
            }
        }