public bool DeleteDisBRank(ArrayList ParameterList, DbTransaction RootDBT)
        {
            bool bResult = false;
            bool IsRootTranscation = false;
            VDS_ALO_DIS_BRANK_DBO DBO = new VDS_ALO_DIS_BRANK_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

                bResult = DBO.doDeleteDisBrank(ParameterList, DBT);


                #region 交易成功

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

                bResult = true;
                #endregion
            }
            catch (Exception ex)
            {
                #region 交易失敗

                bResult = false;

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

                #endregion

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

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

                #endregion

            }

            return bResult;
        }
        /// <summary>
        /// 新增整批退貨率設定
        /// </summary>
        /// <param name="dtBRank"></param>
        /// <param name="V_DIS_NO"></param>
        /// <param name="V_ITEM"></param>
        /// <param name="V_PERIOD"></param>
        /// <param name="RootDBT"></param>
        /// <returns></returns>
        public bool SaveDisBRankInfo(DataTable dtBRank, string V_DIS_NO, string V_ITEM, string V_PERIOD, DbTransaction RootDBT)
        {
            bool bResult = false;
            bool IsRootTranscation = false;
            

            ArrayList ParameterList = new ArrayList();
            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 4.1) 刪除舊資料
                VDS_ALO_DIS_BRANK_DBO DBO = new VDS_ALO_DIS_BRANK_DBO(ref USEDB);
                ParameterList.Clear();
                ParameterList.Add(V_DIS_NO);
                ParameterList.Add(V_ITEM);
                ParameterList.Add(V_PERIOD);
                bResult = DBO.doDeleteDisBrank(ParameterList, DBT);
                if (!bResult)
                {
                    throw new Exception("刪除舊退貨率料異常!");
                }
                #endregion

                #region 4.2) 逐筆新增
                if (dtBRank != null && dtBRank.Rows.Count > 0)
                {

                    for (Int32 i = 0; i <= dtBRank.Rows.Count - 1; i++)
                    {
                        ParameterList.Clear();
                        ParameterList.Add(V_DIS_NO);
                        ParameterList.Add(V_ITEM);
                        ParameterList.Add(V_PERIOD);
                        ParameterList.Add(dtBRank.Rows[i]["DIS_QTY_ST"]);
                        ParameterList.Add(dtBRank.Rows[i]["DIS_QTY_END"]);
                        ParameterList.Add(dtBRank.Rows[i]["BRANK_RATE"]);
                        ParameterList.Add(dtBRank.Rows[i]["UPDATEDATE"]);
                        ParameterList.Add(dtBRank.Rows[i]["UPDATEUID"]);

                        bResult = SaveDisBRank(ParameterList, DBT);
                        if (!bResult)
                        {
                            throw new Exception("新增退貨率異常!");
                        }
                    }
                }



                #endregion

                #region 交易成功

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

                bResult = true;
                #endregion
            }
            catch (Exception ex)
            {
                #region 交易失敗

                bResult = false;

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

                #endregion

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

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

                #endregion

            }

            return bResult;
        }