public DataTable GetDisType109TmpSchema() { #region try { VDS_ALO_DISTYPE_109_TMP_DBO DBO = new VDS_ALO_DISTYPE_109_TMP_DBO(ref USEDB); return DBO.doGetDisType109TmpSchema(); } catch (Exception ex) { throw GetNewException(ex); } #endregion }
public DataTable QueryForCreateDisType109Tmp2(ArrayList ParameterList) { #region try { VDS_ALO_DISTYPE_109_TMP_DBO DBO = new VDS_ALO_DISTYPE_109_TMP_DBO(ref USEDB); DataTable dt = DBO.doQueryForCreateDisType109Tmp2(ParameterList); return dt; } catch (Exception ex) { throw GetNewException(ex); } #endregion }
public bool DeleteDisType109Tmp(ArrayList ParameterList, DbTransaction RootDBT) { bool bResult = false; bool IsRootTranscation = false; try { VDS_ALO_DISTYPE_109_TMP_DBO DBO = new VDS_ALO_DISTYPE_109_TMP_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.doDeleteDisType109Tmp(ParameterList, DBT); #region 交易成功 if (IsRootTranscation) { //獨立呼叫Transcation成立 DBT.Commit(); } #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; }
public bool CreateOne(DataTable dtDisType109Tmp, string V_DIS_NO, DbTransaction RootDBT) { bool bResult = false; bool IsRootTranscation = false; try { VDS_ALO_DISTYPE_109_TMP_DBO DBO = new VDS_ALO_DISTYPE_109_TMP_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 (dtDisType109Tmp != null && dtDisType109Tmp.Rows.Count > 0) { for (Int32 i = 0; i <= dtDisType109Tmp.Rows.Count - 1; i++) { ParameterList.Clear(); ParameterList.Add(V_DIS_NO); ParameterList.Add(dtDisType109Tmp.Rows[i]["ITEM"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["PERIOD"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["RANK_CODE"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["RANK_LEVEL"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["VENDOR"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["PATTERN_NO"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["RANK_STO_QTY"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["RANK_DIS_QTY"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["UPDATEDATE"]); ParameterList.Add(dtDisType109Tmp.Rows[i]["UPDATEUID"]); 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; }