public DataTable QueryCollReport(ArrayList ParameterList) { try { CAA_10DBO DBO = new CAA_10DBO(ref USEDB); DataTable dt = DBO.QueryCollReport(ParameterList); return dt; } catch (Exception ex) { throw ex; } }
/// <summary> /// 取得VDS_CAA_COLL_TMP SCHEMA /// </summary> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable GET_VDS_CAA_COLL_TMP_SCHEMA(ArrayList ParameterList) { try { CAA_10DBO CAA10 = new CAA_10DBO(ref USEDB); return CAA10.GET_VDS_CAA_COLL_TMP_SCHEMA(ParameterList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 取得匯入異常的資料 /// </summary> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable QUERYERRORBYFIND(ArrayList ParameterList) { try { CAA_10DBO CAA10 = new CAA_10DBO(ref USEDB); return CAA10.QUERYERRORBYFIND(ParameterList); } catch (Exception ex) { throw ex; } }
/// <summary> /// CAA101, 按下BUTTON[確定匯入],將TempTable的資料寫入正式Table /// </summary> /// <param name="RootDBT"></param> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable TmpToDB(DbTransaction RootDBT, ArrayList ParameterList) { bool IsRootTranscation = false; DataTable dt_Return = new DataTable(); 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 設定變數 CAA_10DBO CAA10 = new CAA_10DBO(ref USEDB); #endregion #region 將TempTable的資料寫入正式Table dt_Return = CAA10.TmpToDB(DBT, ParameterList); #endregion #region 將文字檔資料,由"UpdTmp"資料夾移動至"UpdBak"資料夾 string s_SourcePath = string.Empty; string s_DestinationPath = string.Empty; DataRow[] dr_Row = dt_Return.Select("STATUS = 'FILE_NAME'"); if (dr_Row.Length == 1) { s_SourcePath = ParameterList[2].ToString() + dr_Row[0]["count"].ToString(); s_DestinationPath = ParameterList[3].ToString() + dr_Row[0]["count"].ToString(); } else { throw new Exception("移動檔案至正式資料夾發生錯誤"); } System.IO.File.Move(s_SourcePath, s_DestinationPath); #endregion #region 交易成功 if (IsRootTranscation) { //獨立呼叫Transcation成立 DBT.Commit(); } #endregion return dt_Return; } 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 } }
/// <summary> /// CAA101, 按下BUTTON[載入檔案],AP端資料匯入至TempTable /// </summary> /// <param name="RootDBT"></param> /// <param name="s_LogUser"></param> /// <param name="dt_VDS_CAA_COLL_TMP"></param> /// <returns></returns> public DataTable FileToTmp(DbTransaction RootDBT, string s_LogUser, DataTable dt_VDS_CAA_COLL_TMP) { bool IsRootTranscation = false; DataTable dt_Return = new DataTable(); 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 設定變數 CAA_10DBO CAA10 = new CAA_10DBO(ref USEDB); #endregion #region 刪除 VDS_CAA_COLL_TMP 的資料 CAA10.DELETE_VDS_CAA_COLL_TMP(DBT, s_LogUser); #endregion #region 新增 VDS_CAA_COLL_TMP 的資料 foreach (DataRow dr_Temp in dt_VDS_CAA_COLL_TMP.Rows) { CAA10.ADD_VDS_CAA_COLL_TMP(DBT, dr_Temp); } #endregion #region 檢查文字檔資料是否正確 CAA10.CHECK_FILETOTMP(DBT, s_LogUser); #endregion #region 交易成功 if (IsRootTranscation) { //獨立呼叫Transcation成立 DBT.Commit(); } #endregion #region 取得處理結果 dt_Return = CAA10.GET_THERESULTS(s_LogUser); #endregion return dt_Return; } 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 } }
/// <summary> /// 取得 [手續費] /// </summary> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable GET_CHARGE_INFORMATION(ArrayList ParameterList) { try { CAA_10DBO CAA10 = new CAA_10DBO(ref USEDB); return CAA10.GET_CHARGE_INFORMATION(ParameterList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 檢查在 VDS_CAA_COLL_MAIN 中是否有相同年月(營業日欄位取年月)+相同店號之資料 /// </summary> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable CHECK_REPEAT_DATA(ArrayList ParameterList) { try { CAA_10DBO CAA10 = new CAA_10DBO(ref USEDB); return CAA10.CHECK_REPEAT_DATA(ParameterList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 根據條件從 VDS_STM_ACCOUNT_PROPERTY 取得 STORE /// </summary> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable GET_STORE_FROM_ACCOUNTPROPERTY(ArrayList ParameterList) { try { CAA_10DBO CAA10 = new CAA_10DBO(ref USEDB); return CAA10.GET_STORE_FROM_ACCOUNTPROPERTY(ParameterList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 取得 VDS_CAA_MON_SETTING 的[月結]資訊 /// </summary> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable GET_MONTH_CLOSE_DATA(ArrayList ParameterList) { try { CAA_10DBO CAA10 = new CAA_10DBO(ref USEDB); return CAA10.GET_MONTH_CLOSE_DATA(ParameterList); } catch (Exception ex) { throw ex; } }
public void UpdateMemo(ArrayList ParameterList, DbTransaction RootDBT) { bool IsRootTranscation = false; 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 CAA_10DBO DBO = new CAA_10DBO(ref USEDB); DBO.UpdateMemo(ParameterList, DBT); #region 交易成功 if (IsRootTranscation) { //獨立呼叫Transcation成立 DBT.Commit(); } #endregion } 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 } }