AVIH0401F.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "ITSDbF.h"
  6. #include "AppGlobalF.h"
  7. #include "WindowMsgF.h"
  8. #include "CDSAviF.h"
  9. #pragma hdrstop
  10. #include "AVIH0401F.h"
  11. #include "AVIH040MF.h"
  12. //---------------------------------------------------------------------------
  13. #pragma package(smart_init)
  14. #pragma link "cxButtons"
  15. #pragma link "cxCheckBox"
  16. #pragma link "cxClasses"
  17. #pragma link "cxContainer"
  18. #pragma link "cxControls"
  19. #pragma link "cxCustomData"
  20. #pragma link "cxData"
  21. #pragma link "cxDataStorage"
  22. #pragma link "cxEdit"
  23. #pragma link "cxFilter"
  24. #pragma link "cxGraphics"
  25. #pragma link "cxGrid"
  26. #pragma link "cxGridCustomTableView"
  27. #pragma link "cxGridCustomView"
  28. #pragma link "cxGridLevel"
  29. #pragma link "cxGridTableView"
  30. #pragma link "cxLabel"
  31. #pragma link "cxLookAndFeelPainters"
  32. #pragma link "cxLookAndFeels"
  33. #pragma link "cxStyles"
  34. #pragma link "dxSkinBlack"
  35. #pragma link "dxSkinBlue"
  36. #pragma link "dxSkinsCore"
  37. #pragma link "dxSkinscxPCPainter"
  38. #pragma link "dxmdaset"
  39. #pragma resource "*.dfm"
  40. #define USE_MEMDATA 1
  41. TAVIH0401 *AVIH0401 = NULL;
  42. //---------------------------------------------------------------------------
  43. __fastcall TAVIH0401::TAVIH0401(TComponent* Owner, HWND hHandle, String sFrom, String sTo, String sIdList, bool AAllSel, String ACarNo)
  44. : TForm(Owner)
  45. {
  46. ITSSkin_Load(this);
  47. CMM_LoadForm(g_sFormsDir, this);
  48. FParent = hHandle;
  49. FStDateTime = sFrom;
  50. FEdDateTime = sTo;
  51. FIdList = sIdList;
  52. FAllSel = AAllSel;
  53. FCarNo = ACarNo;
  54. Caption = "AVI-제어기 차량통과 이력";
  55. }
  56. //---------------------------------------------------------------------------
  57. __fastcall TAVIH0401::~TAVIH0401(void)
  58. {
  59. }
  60. //--------------------------------------------------------------------------
  61. /*
  62. * form 초기화
  63. *
  64. * arguments
  65. *
  66. * return
  67. * void
  68. */
  69. void __fastcall TAVIH0401::FormInit()
  70. {
  71. ADOQry->Connection = ITSDb_GetConnection();
  72. m_pGDC = TvList->DataController;
  73. TvList->OptionsView->NoDataToDisplayInfoText = FrmLang->lblNoInfo->Caption;//"<AVI-제어기 차량통과 이력 정보>";
  74. //TvList->ViewInfo->GroupByBoxViewInfo->Text = "그룹핑할 필드의 헤더를 이곳으로 드래그 하세요";
  75. #if 0
  76. LblSearch->Caption = "검색조건: " + FStDateTime.SubString(1, 10) + " ~ " + FEdDateTime.SubString(1, 10);
  77. #else
  78. LblSearch->Caption = "검색조건: " + FStDateTime.SubString(1, 12) + " ~ " + FEdDateTime.SubString(1, 12);
  79. #endif
  80. }
  81. //---------------------------------------------------------------------------
  82. /*
  83. * form을 보여줄때 호출되는 event 메서드이다.
  84. * arguments
  85. * Sender : event handler 객체
  86. * return
  87. * void
  88. */
  89. void __fastcall TAVIH0401::FormShow(TObject *Sender)
  90. {
  91. FormInit();
  92. Refresh();
  93. TmrShow->Enabled = true;
  94. }
  95. //---------------------------------------------------------------------------
  96. /*
  97. * 닫기버튼 이나 x버튼 클릭시 공통으로 처리하는 로직이들어간다..
  98. * Form과 DataModule class를 delete시킨다.
  99. * arguments
  100. *
  101. * return
  102. * void
  103. */
  104. void __fastcall TAVIH0401::CommClose()
  105. {
  106. CMM_SaveForm(g_sFormsDir, this);
  107. //AVIH0401 = NULL;
  108. }
  109. //---------------------------------------------------------------------------
  110. /*
  111. * 최초 1회 수행되는 타이머 이벤트
  112. * arguments
  113. * Sender : event handler 객체
  114. * return
  115. * void
  116. */
  117. void __fastcall TAVIH0401::TmrShowTimer(TObject *Sender)
  118. {
  119. TmrShow->Enabled = false;
  120. Application->ProcessMessages();
  121. CMM_ClearGridTableView(TvList);
  122. Application->ProcessMessages();
  123. #if USE_MEMDATA
  124. try
  125. {
  126. TvList->BeginUpdate(lsimImmediate);
  127. #endif
  128. SelHistory();
  129. #if USE_MEMDATA
  130. }
  131. __finally
  132. {
  133. TvList->EndUpdate();
  134. }
  135. #endif
  136. }
  137. //---------------------------------------------------------------------------
  138. void __fastcall TAVIH0401::ChkExpandClick(TObject *Sender)
  139. {
  140. CMM_ExpandCollapseChk(TvList, ChkExpand->Checked);
  141. }
  142. //---------------------------------------------------------------------------
  143. /*
  144. * Refresh Data Event Function
  145. * arguments
  146. *
  147. * return
  148. * void
  149. */
  150. void __fastcall TAVIH0401::SelHistory()
  151. {
  152. TSqlCursor sqlCrs;
  153. String sQry;
  154. TADOQuery *pADO = ADOQry;
  155. sQry = "SELECT A.AVI_CTLR_MNGM_NMBR, \r\n"
  156. " TO_CHAR(TO_DATE(A.CRTN_DT, 'YYYYMMDDHH24MISS'), 'YYYY-MM-DD HH24:MI:SS') AS CRTN_DT, \r\n"
  157. " A.WHOL_VHCL_NMBR, A.VHCL_NMBR, A.LANE_NMBR, \r\n"
  158. " DECODE(A.LANE_DRCT, 'ACD0', '상행', \r\n"
  159. " 'ACD1', '하행', '') AS LANE_DRCT, \r\n"
  160. " DECODE(A.VHCL_KIND_CD, '1', '승용차', \r\n"
  161. " '2', '버스', \r\n"
  162. " '3', '트럭', \r\n"
  163. " '4', '합', \r\n"
  164. " '5', '특장', '') AS VHCL_KIND_CD \r\n"
  165. " FROM TB_AVI_PASS_VHCL A \r\n"
  166. " WHERE 1 = 1 \r\n"
  167. " AND A.CRTN_DT BETWEEN :p01 AND :p02 \r\n";
  168. if (FCarNo != "")
  169. {
  170. sQry+= " AND A.WHOL_VHCL_NMBR LIKE '%' || :p03 || '%' \r\n";
  171. }
  172. else
  173. {
  174. if (FAllSel == false)
  175. {
  176. sQry+= " AND A.AVI_CTLR_MNGM_NMBR IN(" + FIdList + ") \r\n";
  177. }
  178. }
  179. #if 0
  180. sQry+= " ORDER BY A.AVI_CTLR_MNGM_NMBR ASC, A.WHOL_VHCL_NMBR, A.CRTN_DT DESC \r\n";
  181. #endif
  182. try
  183. {
  184. ITSDb_SQLText(pADO, sQry);
  185. ITSDb_SQLBind(pADO, "p01", FStDateTime);
  186. ITSDb_SQLBind(pADO, "p02", FEdDateTime);
  187. if (FCarNo != "")
  188. {
  189. ITSDb_SQLBind(pADO, "p03", FCarNo);
  190. }
  191. ITSDb_SQLOpen(pADO);
  192. #if USE_MEMDATA
  193. dxMemData1->DisableControls();
  194. dxMemData1->Close();
  195. dxMemData1->CreateFieldsFromDataSet(pADO);
  196. dxMemData1->LoadFromDataSet(pADO);
  197. dxMemData1->Open();
  198. dxMemData1->First();
  199. dxMemData1->EnableControls();
  200. pADO->Close();
  201. DspHistoryMemData();
  202. #else
  203. DspHistory();
  204. #endif
  205. }
  206. catch(EDatabaseError &E)
  207. {
  208. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  209. DBERRORMSG(Caption, String(E.ClassName()), E.Message, sQry);
  210. throw Exception(String(E.ClassName()) + E.Message);
  211. }
  212. catch(Exception &exception)
  213. {
  214. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  215. DBERRORMSG(Caption, String(exception.ClassName()), exception.Message, sQry);
  216. throw Exception(String(exception.ClassName()) + exception.Message);
  217. }
  218. }
  219. //---------------------------------------------------------------------------
  220. void __fastcall TAVIH0401::SelHistory2()
  221. {
  222. TSqlCursor sqlCrs;
  223. String sQry;
  224. TADOQuery *pADO = ADOQry;
  225. sQry = "SELECT A.AVI_CTLR_MNGM_NMBR, B.AVI_ID, B.AVI_LCTN_NM, A.CRTN_DT, \r\n"
  226. " A.WHOL_VHCL_NMBR, A.VHCL_NMBR, A.LANE_NMBR, \r\n"
  227. " DECODE(A.LANE_DRCT, 'ACD0', '상행', \r\n"
  228. " 'ACD1', '하행', '') AS LANE_DRCT, \r\n"
  229. " DECODE(A.VHCL_KIND_CD, '1', '승용차', \r\n"
  230. " '2', '버스', \r\n"
  231. " '3', '트럭', \r\n"
  232. " '4', '합', \r\n"
  233. " '5', '특장', '') AS VHCL_KIND_CD \r\n"
  234. " FROM TB_AVI_PASS_VHCL A, TB_AVI_CTLR B \r\n"
  235. " WHERE 1 = 1 \r\n"
  236. " AND A.AVI_CTLR_MNGM_NMBR = B.AVI_CTLR_MNGM_NMBR \r\n";
  237. if (FCarNo != "")
  238. {
  239. sQry+= " AND A.WHOL_VHCL_NMBR LIKE '%' || :p03 || '%' \r\n";
  240. }
  241. else
  242. {
  243. if (FAllSel == false)
  244. {
  245. sQry+= " AND B.AVI_CTLR_MNGM_NMBR IN(" + FIdList + ") \r\n";
  246. }
  247. }
  248. sQry+= " AND A.CRTN_DT BETWEEN :p01 AND :p02 \r\n";
  249. #if 0
  250. sQry+= " ORDER BY A.AVI_CTLR_MNGM_NMBR ASC, A.WHOL_VHCL_NMBR, A.CRTN_DT DESC \r\n";
  251. #endif
  252. try
  253. {
  254. ITSDb_SQLText(pADO, sQry);
  255. ITSDb_SQLBind(pADO, "p01", FStDateTime);
  256. ITSDb_SQLBind(pADO, "p02", FEdDateTime);
  257. if (FCarNo != "")
  258. {
  259. ITSDb_SQLBind(pADO, "p03", FCarNo);
  260. }
  261. ITSDb_SQLOpen(pADO);
  262. #if USE_MEMDATA
  263. dxMemData1->DisableControls();
  264. dxMemData1->Close();
  265. dxMemData1->CreateFieldsFromDataSet(pADO);
  266. dxMemData1->LoadFromDataSet(pADO);
  267. dxMemData1->Open();
  268. dxMemData1->First();
  269. dxMemData1->EnableControls();
  270. pADO->Close();
  271. DspHistoryMemData();
  272. #else
  273. DspHistory();
  274. #endif
  275. }
  276. catch(EDatabaseError &E)
  277. {
  278. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  279. DBERRORMSG(Caption, String(E.ClassName()), E.Message, sQry);
  280. throw Exception(String(E.ClassName()) + E.Message);
  281. }
  282. catch(Exception &exception)
  283. {
  284. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  285. DBERRORMSG(Caption, String(exception.ClassName()), exception.Message, sQry);
  286. throw Exception(String(exception.ClassName()) + exception.Message);
  287. }
  288. }
  289. //---------------------------------------------------------------------------
  290. void __fastcall TAVIH0401::SelHistoryBackup()
  291. {
  292. TSqlCursor sqlCrs;
  293. String sQry;
  294. TADOQuery *pADO = ADOQry;
  295. sQry = "SELECT A.AVI_CTLR_MNGM_NMBR, B.AVI_ID, B.AVI_LCTN_NM, A.CRTN_DT, \r\n"
  296. " WHOL_VHCL_NMBR, CRTN_DT, VHCL_NMBR, LANE_NMBR, \r\n"
  297. #if 0
  298. " (SELECT CMMN_CD_KOR_NM FROM TB_CMMN_CD WHERE CMMN_CD = A.LANE_DRCT AND CMMN_CLSF_CD = 'APV') LANE_DRCT, \r\n"
  299. " (SELECT CMMN_CD_KOR_NM FROM TB_CMMN_CD WHERE CMMN_CD = A.VHCL_KIND_CD AND CMMN_CLSF_CD = 'VTC') VHCL_KIND_CD \r\n"
  300. #else
  301. " (SELECT CMMN_CD_KOR_NM FROM TB_CMMN_CD WHERE CMMN_CD = A.LANE_DRCT AND CMMN_CLSF_CD = 'ACD') LANE_DRCT, \r\n"
  302. " (SELECT CMMN_CD_KOR_NM FROM TB_CMMN_CD WHERE CMMN_CD = A.VHCL_KIND_CD AND CMMN_CLSF_CD = 'VTC') VHCL_KIND_CD \r\n"
  303. #endif
  304. " FROM TB_AVI_PASS_VHCL A, TB_AVI_CTLR B \r\n"
  305. " WHERE A.CRTN_DT BETWEEN :p01 AND :p02 \r\n"
  306. " AND A.AVI_CTLR_MNGM_NMBR = B.AVI_CTLR_MNGM_NMBR \r\n";
  307. if (FCarNo != "")
  308. {
  309. sQry+= " AND A.WHOL_VHCL_NMBR LIKE '%' || :p03 || '%' \r\n";
  310. }
  311. else
  312. {
  313. if (FAllSel == false)
  314. {
  315. sQry+= " AND B.AVI_CTLR_MNGM_NMBR IN(" + FIdList + ") \r\n";
  316. }
  317. }
  318. sQry+= " ORDER BY A.AVI_CTLR_MNGM_NMBR ASC, A.WHOL_VHCL_NMBR, A.CRTN_DT DESC \r\n";
  319. #if 0
  320. sQry = "SELECT AVI_CTLR_MNGM_NMBR, WHOL_VHCL_NMBR, CRTN_DT, VHCL_NMBR, LANE_NMBR, \r\n"
  321. " LANE_DRCT, VHCL_KIND_CD \r\n"
  322. " FROM TB_AVI_PASS_VHCL \r\n"
  323. " WHERE CRTN_DT BETWEEN :p01 AND :p02 \r\n"
  324. " AND AVI_CTLR_MNGM_NMBR IN(" + FIdList + ") \r\n"
  325. " ORDER BY AVI_CTLR_MNGM_NMBR, WHOL_VHCL_NMBR, CRTN_DT \r\n";
  326. #endif
  327. try
  328. {
  329. ITSDb_SQLText(pADO, sQry);
  330. ITSDb_SQLBind(pADO, "p01", FStDateTime);
  331. ITSDb_SQLBind(pADO, "p02", FEdDateTime);
  332. if (FCarNo != "")
  333. {
  334. ITSDb_SQLBind(pADO, "p03", FCarNo);
  335. }
  336. ITSDb_SQLOpen(pADO);
  337. #if USE_MEMDATA
  338. dxMemData1->DisableControls();
  339. dxMemData1->Close();
  340. dxMemData1->CreateFieldsFromDataSet(pADO);
  341. dxMemData1->LoadFromDataSet(pADO);
  342. dxMemData1->Open();
  343. dxMemData1->First();
  344. dxMemData1->EnableControls();
  345. pADO->Close();
  346. DspHistoryMemData();
  347. #else
  348. DspHistory();
  349. #endif
  350. }
  351. catch(EDatabaseError &E)
  352. {
  353. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  354. DBERRORMSG(Caption, String(E.ClassName()), E.Message, sQry);
  355. throw Exception(String(E.ClassName()) + E.Message);
  356. }
  357. catch(Exception &exception)
  358. {
  359. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  360. DBERRORMSG(Caption, String(exception.ClassName()), exception.Message, sQry);
  361. throw Exception(String(exception.ClassName()) + exception.Message);
  362. }
  363. }
  364. //---------------------------------------------------------------------------
  365. void __fastcall TAVIH0401::DspHistory()
  366. {
  367. TADOQuery *pADO = ADOQry;
  368. try
  369. {
  370. TcxGridChartSeries *pChart = NULL;
  371. CMM_ClearGridTableView(TvList);
  372. int nRow = 0;
  373. int nDataCnt = 0;
  374. try {
  375. TvList->BeginUpdate();
  376. nDataCnt = pADO->RecordCount;
  377. m_pGDC->RecordCount = nDataCnt;
  378. for( ; !pADO->Eof; pADO->Next(), nRow++)
  379. {
  380. m_pGDC->Values[nRow][Column00->Index] = pADO->FieldByName("AVI_CTLR_MNGM_NMBR")->AsString;
  381. m_pGDC->Values[nRow][Column11->Index] = pADO->FieldByName("AVI_ID")->AsString;
  382. m_pGDC->Values[nRow][Column09->Index] = pADO->FieldByName("AVI_LCTN_NM")->AsString;
  383. m_pGDC->Values[nRow][Column01->Index] = pADO->FieldByName("WHOL_VHCL_NMBR")->AsString;
  384. m_pGDC->Values[nRow][Column02->Index] = ITSUtil_StrToDateTime(pADO->FieldByName("CRTN_DT")->AsString).FormatString(STR_DATETIME); //TODO
  385. m_pGDC->Values[nRow][Column03->Index] = pADO->FieldByName("VHCL_NMBR")->AsString;
  386. m_pGDC->Values[nRow][Column04->Index] = pADO->FieldByName("LANE_NMBR")->AsString;
  387. m_pGDC->Values[nRow][Column05->Index] = pADO->FieldByName("LANE_DRCT")->AsString;
  388. m_pGDC->Values[nRow][Column06->Index] = pADO->FieldByName("VHCL_KIND_CD")->AsString;
  389. }
  390. }
  391. __finally
  392. {
  393. if (pADO)
  394. {
  395. pADO->Close();
  396. }
  397. TvList->EndUpdate();
  398. //CxList->SetFocus();
  399. LblRecords->Caption = FormatFloat("##,##0", m_pGDC->RecordCount) + " 건";
  400. String sEnd = "데이터 " + LblRecords->Caption + " 이 조회 되었습니다.";
  401. Application->MessageBox(sEnd.c_str(), L"데이터 조회 완료", MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
  402. }
  403. }
  404. catch(EDatabaseError &E)
  405. {
  406. throw Exception(String(E.ClassName()) + E.Message);
  407. }
  408. catch(...)
  409. {
  410. throw Exception(FrmLang->lblDbErr->Caption);//"알수없는 오류가 발생하였습니다.");
  411. }
  412. }
  413. //---------------------------------------------------------------------------
  414. void __fastcall TAVIH0401::DspHistoryMemData()
  415. {
  416. TAVIH040M *FRM = (TAVIH040M*)this->Owner;
  417. try
  418. {
  419. TcxGridChartSeries *pChart = NULL;
  420. //CMM_ClearGridTableView(TvList);
  421. int nRow = 0;
  422. int nDataCnt = 0;
  423. try {
  424. while(!dxMemData1->Eof)
  425. {
  426. String AVI_CTLR_MNGM_NMBR = dxMemData1->Fields->FieldByName("AVI_CTLR_MNGM_NMBR")->AsString;
  427. TItsAvi *pObj = FRM->FRAMEAviList1->MyItsAviManager->FLists.Find(AVI_CTLR_MNGM_NMBR);
  428. if (!pObj)
  429. {
  430. dxMemData1->Next();
  431. continue;
  432. }
  433. nRow = m_pGDC->AppendRecord();
  434. m_pGDC->Values[nRow][Column00->Index] = AVI_CTLR_MNGM_NMBR;//dxMemData1->Fields->FieldByName("AVI_CTLR_MNGM_NMBR")->AsString;
  435. m_pGDC->Values[nRow][Column11->Index] = pObj->AVI_ID;// dxMemData1->Fields->FieldByName("AVI_ID")->AsString;
  436. m_pGDC->Values[nRow][Column09->Index] = pObj->AVI_LCTN_NM; //dxMemData1->Fields->FieldByName("AVI_LCTN_NM")->AsString;
  437. m_pGDC->Values[nRow][Column01->Index] = dxMemData1->Fields->FieldByName("WHOL_VHCL_NMBR")->AsString;
  438. //m_pGDC->Values[nRow][Column02->Index] = ITSUtil_StrToDateTime(dxMemData1->Fields->FieldByName("CRTN_DT")->AsString).FormatString(STR_DATETIME); //TODO
  439. m_pGDC->Values[nRow][Column02->Index] = dxMemData1->Fields->FieldByName("CRTN_DT")->AsString; //TODO
  440. m_pGDC->Values[nRow][Column03->Index] = dxMemData1->Fields->FieldByName("VHCL_NMBR")->AsString;
  441. m_pGDC->Values[nRow][Column04->Index] = dxMemData1->Fields->FieldByName("LANE_NMBR")->AsString;
  442. m_pGDC->Values[nRow][Column05->Index] = dxMemData1->Fields->FieldByName("LANE_DRCT")->AsString;
  443. m_pGDC->Values[nRow][Column06->Index] = dxMemData1->Fields->FieldByName("VHCL_KIND_CD")->AsString;
  444. dxMemData1->Next();
  445. }
  446. }
  447. __finally
  448. {
  449. dxMemData1->Close();
  450. LblRecords->Caption = FormatFloat("##,##0", m_pGDC->RecordCount) + " 건";
  451. String sEnd = "데이터 " + LblRecords->Caption + " 이 조회 되었습니다.";
  452. Application->MessageBox(sEnd.c_str(), L"데이터 조회 완료", MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
  453. }
  454. }
  455. catch(EDatabaseError &E)
  456. {
  457. throw Exception(String(E.ClassName()) + E.Message);
  458. }
  459. catch(...)
  460. {
  461. throw Exception(FrmLang->lblDbErr->Caption);//"알수없는 오류가 발생하였습니다.");
  462. }
  463. }
  464. //---------------------------------------------------------------------------
  465. void __fastcall TAVIH0401::OnMessage(TMessage &Msg)
  466. {
  467. switch (Msg.Msg)
  468. {
  469. case WM_PARAM_DATABASE:
  470. if (WP_DB_SELECT_OK == Msg.WParam)
  471. {
  472. //ShowMessage("Select Ok");
  473. }
  474. break;
  475. }
  476. }
  477. //---------------------------------------------------------------------------
  478. void __fastcall TAVIH0401::BtnExlSaveClick(TObject *Sender)
  479. {
  480. TcxGrid *pGrid = CxList;
  481. TcxGridTableView *pView = TvList;
  482. String sTitle = "AVI-제어기 차량통과이력";
  483. CMM_ExportToExcelFile(sTitle, pGrid, pView, this);
  484. }
  485. //---------------------------------------------------------------------------
  486. void __fastcall TAVIH0401::FormClose(TObject *Sender, TCloseAction &Action)
  487. {
  488. POST_MSG(FParent, WM_SUBFORM_CLOSE, 0, 0);
  489. CommClose();
  490. //AVIH0401 = NULL;
  491. }
  492. //---------------------------------------------------------------------------