public DataTable GetChanRtnData(ArrayList ParameterList, out string strMsg, out string strResult)
        {
            DBO.VDS_CGR02_DBO CGRM = new VDS_CGR02_DBO(ref USEDB);

            DataTable Dt;

            try
            {
                Dt = CGRM.GetChanRtnData(ParameterList, out strMsg, out strResult);
                return Dt;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public DataTable GetErrData(ArrayList ParameterList)
        {
            DBO.VDS_CGR02_DBO CGRM = new VDS_CGR02_DBO(ref USEDB);

            DataTable Dt;

            try
            {
                Dt = CGRM.GetErrData(ParameterList);
                return Dt;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public DataTable CreateBackWard(ArrayList ParameterList, DbTransaction RootDBT, DataTable Dt_Detail,out string strInOut_No,
            out string strMsg, out string strResult, out string strMainID, out string strAdjustNo, out ArrayList ErrList)
        {
            bool IsRootTranscation = false;

            DBO.VDS_CGR02_DBO CGRM = new VDS_CGR02_DBO(ref USEDB);

            ArrayList AL = new ArrayList();
            DataTable Dt = new DataTable();
            strInOut_No = string.Empty;
            strMainID = string.Empty;
            strAdjustNo = string.Empty;
            ErrList = new ArrayList();

            //ParameterList[0] @IsAdjust
            //ParameterList[1] @Type 
            //ParameterList[2] @BatchNos
            //ParameterList[3] @ChanNo 
            //ParameterList[4] @CreateID 
            //parameterList[5] @V_TIMESTAMP

            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

                if (ParameterList[1].ToString() == "0") // type = 0
                {
                    AL.Clear();

                    AL.Add(ParameterList[5].ToString());//V_TIMESTAMP
                    AL.Add(ParameterList[4].ToString()); //CreateID 

                    Dt = CGRM.GenBackwardBySorter(AL, DBT, out strInOut_No, out strMsg, out strResult);
                }
                else // type = 1
                {
                    AL.Clear();

                    AL.Add(ParameterList[3].ToString()); //ChanNo
                    AL.Add(ParameterList[2].ToString()); //BatchNos
                    AL.Add(ParameterList[4].ToString()); //CreateID 

                    Dt = CGRM.GenBackwardByChan(AL, DBT, out strInOut_No, out strMsg, out strResult);
                }

                if (strResult == "1")
                {

                    if (ParameterList[0].ToString() == "1") //IsAdjust
                    {
                        PIC.VDS2G.VSM.IVM.MaintainAdjustData IVM = new PIC.VDS2G.VSM.IVM.MaintainAdjustData(strConfig);

                        AL.Clear();

                        AL.Add(ParameterList[4].ToString()); //CreateID
                        AL.Add(DateTime.Now.ToString("yyyyMMddHHmmss"));
                        AL.Add("E3");

                        bool blresult = IVM.CreateAdjustData(AL, Dt_Detail, DBT, out strMainID, out strAdjustNo, out ErrList);

                        if (blresult == false)
                        {
                            throw new Exception(" 新增調整單失敗!! ");
                        }
                        else
                        {
                            AL.Clear();
                            AL.Add(strInOut_No);
                            AL.Add(strAdjustNo);

                            CGRM.UpdateStockInAdjustInfo(AL, DBT);
                        }
                    }
                }
                else
                {
                    throw new Exception(strMsg);
                }

                #region 交易成功

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

                #endregion

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

            }
        }