| | |
| | | using System;
|
| | |
|
| | | using System.Data.OracleClient;
|
| | | using NLog;
|
| | |
|
| | | namespace CCSTrace.CCS.Object
|
| | | {
|
| | | public class CcsRecord
|
| | | {
|
| | | private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
| | |
|
| | | private readonly string _meter;
|
| | | private readonly string _customerName;
|
| | | private readonly string _customerTel;
|
| | |
| | | _acceptTime = accepttime;
|
| | | }
|
| | |
|
| | | public CcsRecord(string ccsid, OracleConnection connectionTpc, SEventLog pLog)
|
| | | public CcsRecord(string ccsid, OracleConnection connectionTpc)
|
| | | {
|
| | | var sqlStmt = "SELECT METER,CUSTOMERNAME,CUSTOMERTEL,ADDR_CITY,ADDR_TOWN,ADDR_ROAD,ADDR_OTHER,RECALLNAME,RECALLTEL,EVENTBRIEF,"
|
| | | + "TO_CHAR(ACCEPTTIME,'YYYY/MM/DD HH24:MI:SS') as ACCEPTTIME,CCSID,IMPORTCASE,DEPT,PARTHICUSTOMER,NOTE FROM CCS.EVENTRECORD "
|
| | |
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | pLog.Error("無法取得CCS報案資訊!" + e.Message);
|
| | | Console.WriteLine(e.StackTrace);
|
| | |
|
| | | if (GlobalVariable.ShowError)
|
| | | pLog.Error(e.StackTrace);
|
| | |
|
| | | throw e;
|
| | | Logger.Error(e, "無法取得CCS報案資訊!" + e.Message);
|
| | | throw;
|
| | | }
|
| | | finally
|
| | | {
|
| | |
| | |
|
| | | public string Note => _note;
|
| | |
|
| | | public bool InsertDb(OracleConnection connectionTpc, OracleTransaction transaction, SEventLog pLog)
|
| | | public bool InsertDb(OracleConnection connectionTpc, OracleTransaction transaction)
|
| | | {
|
| | | var sqlStmt = "INSERT INTO CCS.EVENTRECORD VALUES ('" + _meter + "','" + _customerName + "','" + _customerTel + "','" + _addrCity + "','"
|
| | | + _addrTown + "','" + _addrRoad + "','" + _addrOther + "','" + _recallName + "','" + _recallTel + "',"
|
| | |
| | | {
|
| | | if (command.ExecuteNonQuery() != 1)
|
| | | {
|
| | | pLog.Error("CCS 案件受理程序初始化失敗...無法將CCS報案資訊存入資料庫中!");
|
| | |
|
| | | throw new Exception("CCS 案件受理程序初始化失敗...無法將CCS報案資訊存入資料庫中!");
|
| | | }
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Console.WriteLine(e.StackTrace);
|
| | |
|
| | | if (GlobalVariable.ShowError)
|
| | | pLog.Error(e.StackTrace);
|
| | |
|
| | | pLog.Error("CCS 案件受理程序初始化失敗...無法將CCS報案資訊存入資料庫中!" + e.Message);
|
| | | //throw new Exception("CCS 案件受理程序初始化失敗...無法將CCS報案資訊存入資料庫中");
|
| | | Logger.Error(e, e.Message);
|
| | | throw;
|
| | | }
|
| | | finally
|