Пример #1
0
 public DataTable GetDisRecSchema()
 {
     #region
     try
     {
         VDS_ALO_DIS_REC_DBO DBO = new VDS_ALO_DIS_REC_DBO(ref USEDB);
         return DBO.doGetDisRecSchema();
     }
     catch (Exception ex)
     {
         throw GetNewException(ex);
     }
     #endregion
 }
Пример #2
0
 public DataTable QueryByOpCode(ArrayList ParameterList)
 {
     #region
     try
     {
         VDS_ALO_DIS_REC_DBO ALOM = new VDS_ALO_DIS_REC_DBO(ref USEDB);
         DataTable dt = ALOM.doQueryByOpCode(ParameterList);
         return dt;
     }
     catch (Exception ex)
     {
         throw GetNewException(ex);
     }
     #endregion
 }
Пример #3
0
        public bool CreateDisTmpRec(DataTable dtDisTmpRec,string strDisNo, DbTransaction RootDBT)
        {
            #region
            bool bResult = false;
            bool IsRootTranscation = false;

            try
            {
                VDS_ALO_DIS_REC_DBO DBO = new VDS_ALO_DIS_REC_DBO(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

                ArrayList ParameterList = new ArrayList();

                if (dtDisTmpRec != null && dtDisTmpRec.Rows.Count > 0)
                {

                    for (Int32 i = 0; i <= dtDisTmpRec.Rows.Count - 1; i++)
                    {
                        ParameterList.Clear();
                        ParameterList.Add(dtDisTmpRec.Rows[i]["CODE"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["CREATEDATE"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["CREATEUID"]);
                        ParameterList.Add(strDisNo);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["DIS_DATE"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["ST_ACCEPT_DATE"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["PO_SOURCE_NO"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["MEMO"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["ITEM"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["PERIOD"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["PATTERN_NO"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["ISS_DATE"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["DIS_TYPE"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["INCLUDE_NON_EFF"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["ACCEPT_QTY"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["PUR_QTY"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["ONHD_QTY"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["ORDER_CHANGE"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["SP_CHANGE"]);
                        ParameterList.Add(dtDisTmpRec.Rows[i]["OP_CODE"]);
                        bResult = DBO.doCreateOne(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;
            #endregion
        }
Пример #4
0
        /// <summary>
        /// 由頁面暫存檔刪除時,將OP_CODE清空
        /// </summary>
        /// <param name="dtDisTmpRec"></param>
        /// <param name="strDisNo"></param>
        /// <param name="RootDBT"></param>
        /// <returns></returns>
        public bool DeleteForPageTmp(ArrayList ParameterList, DbTransaction RootDBT)
        {
            #region
            bool bResult = false;
            bool IsRootTranscation = false;

            try
            {
                VDS_ALO_DIS_REC_DBO DBO = new VDS_ALO_DIS_REC_DBO(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
                bResult = DBO.doDeleteForPageTmp(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;
            #endregion
        }