/// <summary> /// /// </summary> /// <param name="ParameterList"> /// 0.V_VENDOR /// </param> /// <returns></returns> public DataTable GetMainByVendor(ArrayList ParameterList) { try { //V_VENDOR VARCHAR2 VAM28_DBO DBO = new VAM28_DBO(ref USEDB); return DBO.doGetMainByVendor(ParameterList); } catch (Exception ex) { throw ex; } }
public DataTable ViewOilSubsidyRecord_Main(ArrayList ParameterList) { try { //N_ID VAM28_DBO DBO = new VAM28_DBO(ref USEDB); return DBO.doViewOilSubsidyRecord_Main(ParameterList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 查詢 /// </summary> /// <param name="ParameterList"> /// 0.V_VENDOR_S /// 1.V_VENDOR_E /// 2.V_ITEM_S /// 3.V_ITEM_E /// 4.V_CREATEDATE_S /// 5.V_CREATEDATE_E /// 6.V_CREATEUID /// 7.V_UPDATEDATE_S /// 8.V_UPDATEDATE_E /// 9.V_UPDATEUID /// 10.N_ROWNUM /// </param> /// <returns></returns> public DataTable QueryOilSubsidyByFind(ArrayList ParameterList) { try { //V_VENDOR_S VARCHAR2, //V_VENDOR_E VARCHAR2, //V_ITEM_S VARCHAR2, //V_ITEM_E VARCHAR2, //V_CREATEDATE_S VARCHAR2, //V_CREATEDATE_E VARCHAR2, //V_CREATEUID VARCHAR2, //V_UPDATEDATE_S VARCHAR2, //V_UPDATEDATE_E VARCHAR2, //V_UPDATEUID VARCHAR2, //N_ROWNUM NUMBER, VAM28_DBO DBO = new VAM28_DBO(ref USEDB); return DBO.QueryOilSubsidyByFind(ParameterList); } catch (Exception ex) { throw ex; } }
public DataTable Get_StoreGroupData(ArrayList ParameterList) { try { //V_CODE VARCHAR2 VAM28_DBO DBO = new VAM28_DBO(ref USEDB); return DBO.doGet_StoreGroupData(ParameterList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 刪除資料 /// </summary> /// <param name="arrMain"> /// 0. ID NUMBER, /// 1. USERID VARCHAR2, /// 2. OLD_UPDATEDATE varchar2, --舊值 /// 3. OLD_UPDATEUID varchar2 --舊值 /// </param> /// <param name="dtItem"></param> /// <param name="RootDBT"></param> public void DeleteOilSubsidyRecord(ArrayList arrMain, DbTransaction RootDBT) { bool IsRootTranscation = false; string strID = arrMain[0].ToString(); string strUSERID = arrMain[1].ToString(); string strOLD_UPDATEDATE = arrMain[2].ToString(); string strOLD_UPDATEUID = arrMain[3].ToString(); ArrayList ParameterList = new ArrayList(); try { VAM28_DBO DBO = new VAM28_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 //N_ID NUMBER, //V_USERID VARCHAR2, //V_OLD_UPDATEDATE varchar2, --舊值 //V_OLD_UPDATEUID varchar2 --舊值 ParameterList.Clear(); ParameterList.Add(strID); ParameterList.Add(strUSERID); ParameterList.Add(strOLD_UPDATEDATE); ParameterList.Add(strOLD_UPDATEUID); DBO.DeleteOilSubsidyRecord_M_Item(DBT, ParameterList); //刪除明細 DBO.DeleteOilSubsidyRecord_Main(DBT, ParameterList); //刪除主檔 if (IsRootTranscation) DBT.Commit(); } catch (Exception ex) { DBT.Rollback(); throw ex; } finally { #region 判斷是否關閉交易連線 if (IsRootTranscation) { //獨立呼叫Transcation,關閉連線 if (Conn.State == ConnectionState.Connecting) { Conn.Close(); } } #endregion } }
/// <summary> /// 異動資料 /// </summary> /// <param name="arrMain"> /// 0. ID NUMBER, /// 1. VENDOR VARCHAR2, /// 2. ITEM VARCHAR2, /// 3. SUBSIDY_RATE NUMBER, /// 4. USERID VARCHAR2, /// 5. OLD_UPDATEDATE varchar2, --舊值 /// 6. OLD_UPDATEUID varchar2 --舊值 /// </param> /// <param name="dtItem"></param> /// <param name="RootDBT"></param> public void UpdateOilSubsidyRecord(ArrayList arrMain, DataTable dtItem, DbTransaction RootDBT) { bool IsRootTranscation = false; string strID = arrMain[0].ToString(); string strVENDOR = arrMain[1].ToString(); string strITEM = arrMain[2].ToString(); string strSUBSIDY_RATE = arrMain[3].ToString(); string strUSERID = arrMain[4].ToString(); string strOLD_UPDATEDATE = arrMain[5].ToString(); string strOLD_UPDATEUID = arrMain[6].ToString(); ArrayList ParameterList = new ArrayList(); try { VAM28_DBO DBO = new VAM28_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 //刪除舊明細資料 //N_ID NUMBER, //V_USERID VARCHAR2, //V_OLD_UPDATEDATE varchar2, --舊值 //V_OLD_UPDATEUID varchar2 --舊值 ParameterList.Clear(); ParameterList.Add(strID); ParameterList.Add(strUSERID); ParameterList.Add(strOLD_UPDATEDATE); ParameterList.Add(strOLD_UPDATEUID); DBO.DeleteOilSubsidyRecord_M_Item(DBT, ParameterList); //寫入新明細資料 for (int i = 0; i < dtItem.Rows.Count; i++) { //N_ID NUMBER, //V_VENDOR VARCHAR2, //V_ITEM VARCHAR2, //V_STOREGROUP VARCHAR2, //V_USERID VARCHAR2 ParameterList.Clear(); ParameterList.Add(strID); ParameterList.Add(strVENDOR); ParameterList.Add(strITEM); ParameterList.Add(dtItem.Rows[i]["STOREGROUP"].ToString()); ParameterList.Add(strUSERID); DBO.CreateOilSubsidyRecord_Item(DBT, ParameterList); } //更新主檔資料 //N_ID NUMBER, //N_SUBSIDY_RATE NUMBER, //V_USERID VARCHAR2, //V_OLD_UPDATEDATE varchar2, --舊值 //V_OLD_UPDATEUID varchar2 --舊值 ParameterList.Clear(); ParameterList.Add(strID); ParameterList.Add(strSUBSIDY_RATE); ParameterList.Add(strUSERID); ParameterList.Add(strOLD_UPDATEDATE); ParameterList.Add(strOLD_UPDATEUID); DBO.UpdateOilSubsidyRecord_Main(DBT, ParameterList); if (IsRootTranscation) DBT.Commit(); } catch (Exception ex) { DBT.Rollback(); throw ex; } finally { #region 判斷是否關閉交易連線 if (IsRootTranscation) { //獨立呼叫Transcation,關閉連線 if (Conn.State == ConnectionState.Connecting) { Conn.Close(); } } #endregion } }