IST0030MF.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "AppGlobalF.h"
  6. #include "CDSCodeF.h"
  7. #include "ITSLangTransF.h"
  8. #pragma hdrstop
  9. #include "IST0030MF.h"
  10. #include "IST00301F.h"
  11. #include "IST00302F.h"
  12. #include "IST00303F.h"
  13. //---------------------------------------------------------------------------
  14. #pragma package(smart_init)
  15. #pragma link "FRAME_LinkListF"
  16. #pragma link "FRAME_RoadListF"
  17. #pragma link "cxButtons"
  18. #pragma link "cxCalendar"
  19. #pragma link "cxCheckBox"
  20. #pragma link "cxClasses"
  21. #pragma link "cxContainer"
  22. #pragma link "cxControls"
  23. #pragma link "cxCustomData"
  24. #pragma link "cxData"
  25. #pragma link "cxDataStorage"
  26. #pragma link "cxDropDownEdit"
  27. #pragma link "cxEdit"
  28. #pragma link "cxFilter"
  29. #pragma link "cxGraphics"
  30. #pragma link "cxGrid"
  31. #pragma link "cxGridCustomTableView"
  32. #pragma link "cxGridCustomView"
  33. #pragma link "cxGridLevel"
  34. #pragma link "cxGridTableView"
  35. #pragma link "cxGroupBox"
  36. #pragma link "cxLabel"
  37. #pragma link "cxLookAndFeelPainters"
  38. #pragma link "cxLookAndFeels"
  39. #pragma link "cxMaskEdit"
  40. #pragma link "cxPC"
  41. #pragma link "cxPCdxBarPopupMenu"
  42. #pragma link "cxSplitter"
  43. #pragma link "cxStyles"
  44. #pragma link "cxTextEdit"
  45. #pragma link "dxSkinBlack"
  46. #pragma link "dxSkinBlue"
  47. #pragma link "dxSkinsCore"
  48. #pragma link "dxSkinscxPCPainter"
  49. #pragma link "FRAME_IfscListF"
  50. #pragma resource "*.dfm"
  51. TIST0030M *IST0030M = NULL;
  52. //---------------------------------------------------------------------------
  53. __fastcall TIST0030M::TIST0030M(TComponent* Owner)
  54. : TForm(Owner)
  55. {
  56. LangTrans->Translate(this, ITSDb_GetConnection());
  57. FTitle = Caption;//"소통정보 통계";
  58. ITSSkin_Load(this);
  59. CMM_LoadForm(g_sFormsDir, this);
  60. ColumnSel->Options->Filtering = false;
  61. m_pFormList = new TList();
  62. TsList01->TabVisible = false;
  63. FRAMELinkList1->PnlTop->Visible = false;
  64. FRAMELinkList1->PnlBottom->Visible = false;
  65. FRAMEIfscList1->PnlTop->Visible = false;
  66. FRAMEIfscList1->PnlBottom->Visible = false;
  67. FRAMERoadList1->PnlTop->Visible = false;
  68. FRAMERoadList1->PnlBottom->Visible = false;
  69. cxPageControl1->ActivePageIndex = 0;
  70. cxPageControl2->ActivePageIndex = 0;
  71. PnlQry->Height = 190;
  72. }
  73. //---------------------------------------------------------------------------
  74. void __fastcall TIST0030M::CommClose()
  75. {
  76. try
  77. {
  78. for (int idx = m_pFormList->Count-1; idx >= 0; idx--)
  79. {
  80. m_pFormList->Delete(idx);
  81. }
  82. delete m_pFormList;
  83. CMM_SaveForm(g_sFormsDir, this);
  84. }
  85. catch(...)
  86. {
  87. }
  88. }
  89. //---------------------------------------------------------------------------
  90. void __fastcall TIST0030M::FormShow(TObject *Sender)
  91. {
  92. Refresh();
  93. FormInit();
  94. TmrShow->Enabled = true;
  95. }
  96. //---------------------------------------------------------------------------
  97. void __fastcall TIST0030M::FormInit()
  98. {
  99. CbStatType->ItemIndex = 0;
  100. TDateTime dtStart = Now()-1;
  101. TDateTime dtEnd = Now();
  102. DtStDate->Date = dtStart;
  103. DtEdDate->Date = dtEnd;
  104. DtStTime->Date = dtStart;
  105. DtEdTime->Date = dtEnd;
  106. //DtStTime->Time = StrToDateTime("00:00");
  107. //DtEdTime->Time = StrToDateTime("23:59");
  108. //시간대 검색
  109. CbStatType1->ItemIndex = 0;
  110. dtStrDate1->DateTime = Now()-1;
  111. dtEndDate1->DateTime = Now();//-1;
  112. CbStrTm1->ItemIndex = 7;
  113. CbEndTm1->ItemIndex = 7;
  114. //지정시각 검색
  115. CbStrTm2->ItemIndex = 7;
  116. CbEndTm2->ItemIndex = 7;
  117. InitQryList();
  118. }
  119. //---------------------------------------------------------------------------
  120. void __fastcall TIST0030M::InitQryList()
  121. {
  122. CMM_ClearGridTableView(TvList);
  123. int nRow = 0;
  124. try
  125. {
  126. TcxDataController *pGDC = TvList->DataController;;
  127. TvList->BeginUpdate();
  128. for (int ii = 0; ii < MAX_QRY_LIST; ii++)
  129. {
  130. nRow = pGDC->AppendRecord();
  131. pGDC->Values[nRow][ColumnSel->Index] = false; //선택
  132. pGDC->Values[nRow][Column00->Index] = "-"; //편집
  133. pGDC->Values[nRow][Column01->Index] = (Now() - (MAX_QRY_LIST-ii)).FormatString("yyyy-MM-dd");
  134. pGDC->Values[nRow][Column02->Index] = "07";
  135. pGDC->Values[nRow][Column03->Index] = "07";
  136. }
  137. }
  138. __finally
  139. {
  140. TvList->EndUpdate();
  141. }
  142. }
  143. //---------------------------------------------------------------------------
  144. void __fastcall TIST0030M::TmrShowTimer(TObject *Sender)
  145. {
  146. TmrShow->Enabled = false;
  147. FRAMELinkList1->UpdateList();
  148. FRAMEIfscList1->UpdateList();
  149. FRAMERoadList1->UpdateList();
  150. }
  151. //---------------------------------------------------------------------------
  152. void __fastcall TIST0030M::RefreshData()
  153. {
  154. // 검색조건에 의한 링크 데이터 조회
  155. try
  156. {
  157. //SelListData();
  158. }
  159. __finally
  160. {
  161. }
  162. }
  163. //---------------------------------------------------------------------------
  164. void __fastcall TIST0030M::BtnSearchClick(TObject *Sender)
  165. {
  166. Application->ProcessMessages();
  167. TSqlCursor sqlCrs((TControl*)BtnSearch);
  168. TcxGrid *pCxList = NULL;
  169. TcxGridTableView *pTvList = NULL;
  170. int nIdCol = -1;
  171. if (cxPageControl1->Properties->ActivePage->PageIndex == 0)
  172. {
  173. pCxList = FRAMELinkList1->CxList;
  174. pTvList = FRAMELinkList1->TvList;
  175. nIdCol = FRAMELinkList1->Column01->Index;
  176. FLinkLevel = 0;
  177. }
  178. else
  179. if (cxPageControl1->Properties->ActivePage->PageIndex == 1)
  180. {
  181. pCxList = FRAMEIfscList1->CxList;
  182. pTvList = FRAMEIfscList1->TvList;
  183. nIdCol = FRAMEIfscList1->Column01->Index;
  184. FLinkLevel = 1;
  185. }
  186. else
  187. if (cxPageControl1->Properties->ActivePage->PageIndex == 2)
  188. {
  189. pCxList = FRAMERoadList1->CxList;
  190. pTvList = FRAMERoadList1->TvList;
  191. nIdCol = FRAMERoadList1->Column01->Index;
  192. FLinkLevel = 2;
  193. }
  194. if (!pTvList) return;
  195. TcxDataController *pGDC = pTvList->DataController;
  196. int nIndex = pGDC->FocusedRecordIndex;
  197. if( nIndex < 0 )
  198. {
  199. Application->MessageBox(FrmLang->lblSelErr->Caption.c_str(),//L"링크를 먼저 선택 하세요.",
  200. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  201. ActiveControl = pCxList;
  202. return;
  203. }
  204. FLinkId = VarToStr(pGDC->Values[nIndex][nIdCol]);
  205. String sStTime, sEdTime, sTemp;
  206. switch(CbStatType->ItemIndex)
  207. {
  208. case 0: //15분 통계
  209. case 1: //시간 통계(1시간)
  210. sStTime = DtStDate->Date.FormatString("yyyyMMdd") + DtStTime->Time.FormatString("hh");
  211. sEdTime = DtEdDate->Date.FormatString("yyyyMMdd") + DtEdTime->Time.FormatString("hh");
  212. FStTime = sStTime + "0000";
  213. FEdTime = sEdTime + "5959";
  214. break;
  215. case 2: //일 통계(1일)
  216. sStTime = DtStDate->Date.FormatString("yyyyMMdd");
  217. sEdTime = DtEdDate->Date.FormatString("yyyyMMdd");
  218. FStTime = sStTime + "000000";
  219. FEdTime = sEdTime + "235959";
  220. break;
  221. case 3: //월 통계(1개월)
  222. sStTime = DtStDate->Date.FormatString("yyyyMM");
  223. sEdTime = DtEdDate->Date.FormatString("yyyyMM");
  224. sTemp.printf(L"%02d", ITSUtil_GetMonthLastDay(AnsiString(sEdTime).c_str()));
  225. FStTime = sStTime + "01000000";
  226. FEdTime = sEdTime + sTemp + "235959";
  227. break;
  228. case 4: //년 통계(1년)
  229. sStTime = DtStDate->Date.FormatString("yyyy");
  230. sEdTime = DtEdDate->Date.FormatString("yyyy");
  231. FStTime = sStTime + "0101000000";
  232. FEdTime = sEdTime + "1231235959";
  233. break;
  234. default:
  235. return;
  236. }
  237. if (sStTime > sEdTime)
  238. {
  239. Application->MessageBox(FrmLang->lblQryDtErr->Caption.c_str(),//L"검색 시작시각이 검색 종료시각 보다 큽니다.",
  240. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  241. ActiveControl = DtStDate;
  242. return;
  243. }
  244. FStatType = CbStatType->ItemIndex;
  245. String sTitle;
  246. sTitle.printf(L"%s - %s(%s~%s) %s ", cxPageControl1->Properties->ActivePage->Caption.c_str(),
  247. CbStatType->Text.c_str(),
  248. sStTime.c_str(),
  249. sEdTime.c_str(),
  250. FLinkId.c_str());
  251. try
  252. {
  253. Application->ProcessMessages();
  254. LockWindowUpdate(Handle);
  255. TcxTabSheet *pSheet = CMM_AddTabSheet(PgTab, sTitle);
  256. if (!pSheet) return;
  257. IST00301 = new TIST00301(this, Handle, FLinkId, sStTime, sEdTime, FLinkLevel, FStatType);
  258. IST00301->Parent = pSheet;
  259. IST00301->Show();
  260. PgTab->ActivePage = pSheet;
  261. pSheet = PgTab->ActivePage;
  262. m_pFormList->Add(IST00301);
  263. }
  264. __finally
  265. {
  266. LockWindowUpdate(0);
  267. }
  268. }
  269. //---------------------------------------------------------------------------
  270. void __fastcall TIST0030M::BtnCloseClick(TObject *Sender)
  271. {
  272. Close();
  273. }
  274. //---------------------------------------------------------------------------
  275. void __fastcall TIST0030M::OnSubFormClose(TMessage Msg)
  276. {
  277. int nActiveIdx = PgTab->ActivePageIndex;
  278. if (nActiveIdx <= 0) return;
  279. LockWindowUpdate(Handle);
  280. TcxTabSheet *pSheet = PgTab->ActivePage;
  281. if (pSheet)
  282. {
  283. delete pSheet;
  284. }
  285. nActiveIdx--; // 첫번째 탭은 화면에 숨겨져 있다.
  286. m_pFormList->Delete(nActiveIdx);
  287. LockWindowUpdate(0);
  288. }
  289. //---------------------------------------------------------------------------
  290. void __fastcall TIST0030M::PgTabDblClick(TObject *Sender)
  291. {
  292. TPoint APoint;
  293. APoint = PgTab->MouseDownPos;
  294. if (PgTab->IndexOfTabAt(APoint.x, APoint.y) != -1)
  295. POST_MSG(Handle, WM_SUBFORM_CLOSE, 0, 0);
  296. }
  297. //---------------------------------------------------------------------------
  298. void __fastcall TIST0030M::FormClose(TObject *Sender, TCloseAction &Action)
  299. {
  300. CommClose();
  301. IST0030M = NULL;
  302. Action = caFree;
  303. }
  304. //---------------------------------------------------------------------------
  305. void __fastcall TIST0030M::CbStatTypePropertiesChange(TObject *Sender)
  306. {
  307. switch(CbStatType->ItemIndex)
  308. {
  309. case 0: //15분 통계
  310. case 1: //시간 통계(1시간)
  311. DtStDate->Format = " yyyy년 MM월 dd일";
  312. DtEdDate->Format = " yyyy년 MM월 dd일";
  313. DtStTime->Visible = true;
  314. DtEdTime->Visible = true;
  315. break;
  316. case 2: //일 통계(1일)
  317. DtStDate->Format = " yyyy년 MM월 dd일";
  318. DtEdDate->Format = " yyyy년 MM월 dd일";
  319. DtStTime->Visible = false;
  320. DtEdTime->Visible = false;
  321. break;
  322. case 3: //월 통계(1개월)
  323. DtStDate->Format = " yyyy년 MM월";
  324. DtEdDate->Format = " yyyy년 MM월";
  325. DtStTime->Visible = false;
  326. DtEdTime->Visible = false;
  327. break;
  328. case 4: //년 통계(1년)
  329. DtStDate->Format = " yyyy년";
  330. DtEdDate->Format = " yyyy년";
  331. DtStTime->Visible = false;
  332. DtEdTime->Visible = false;
  333. break;
  334. }
  335. }
  336. //---------------------------------------------------------------------------
  337. void __fastcall TIST0030M::cxPageControl2PageChanging(TObject *Sender, TcxTabSheet *NewPage,
  338. bool &AllowChange)
  339. {
  340. switch(NewPage->PageIndex)
  341. {
  342. case 0 :
  343. PnlQry->Height = 190;
  344. break;
  345. case 1 :
  346. PnlQry->Height = 220;
  347. break;
  348. case 2 :
  349. PnlQry->Height = 300;
  350. break;
  351. }
  352. }
  353. //---------------------------------------------------------------------------
  354. void __fastcall TIST0030M::BtnSearch1Click(TObject *Sender)
  355. {
  356. Application->ProcessMessages();
  357. TSqlCursor sqlCrs((TControl*)BtnSearch);
  358. TcxGrid *pCxList = NULL;
  359. TcxGridTableView *pTvList = NULL;
  360. int nIdCol = -1;
  361. if (cxPageControl1->Properties->ActivePage->PageIndex == 0)
  362. {
  363. pCxList = FRAMELinkList1->CxList;
  364. pTvList = FRAMELinkList1->TvList;
  365. nIdCol = FRAMELinkList1->Column01->Index;
  366. FLinkLevel = 0;
  367. }
  368. else
  369. if (cxPageControl1->Properties->ActivePage->PageIndex == 1)
  370. {
  371. pCxList = FRAMEIfscList1->CxList;
  372. pTvList = FRAMEIfscList1->TvList;
  373. nIdCol = FRAMEIfscList1->Column01->Index;
  374. FLinkLevel = 1;
  375. }
  376. else
  377. if (cxPageControl1->Properties->ActivePage->PageIndex == 2)
  378. {
  379. pCxList = FRAMERoadList1->CxList;
  380. pTvList = FRAMERoadList1->TvList;
  381. nIdCol = FRAMERoadList1->Column01->Index;
  382. FLinkLevel = 2;
  383. }
  384. if (!pTvList) return;
  385. TcxDataController *pGDC = pTvList->DataController;
  386. int nIndex = pGDC->FocusedRecordIndex;
  387. if( nIndex < 0 )
  388. {
  389. Application->MessageBox(FrmLang->lblSelErr->Caption.c_str(),//L"링크를 먼저 선택 하세요.",
  390. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  391. ActiveControl = pCxList;
  392. return;
  393. }
  394. FLinkId = VarToStr(pGDC->Values[nIndex][nIdCol]);
  395. String sStTime, sEdTime, sTemp;
  396. switch(CbStatType->ItemIndex)
  397. {
  398. case 0: //15분 통계
  399. case 1: //시간 통계(1시간)
  400. sStTime = dtStrDate1->DateTime.FormatString("yyyyMMdd");
  401. sEdTime = dtEndDate1->DateTime.FormatString("yyyyMMdd");
  402. FStTime = sStTime + "000000";
  403. FEdTime = sEdTime + "235959";
  404. break;
  405. default:
  406. return;
  407. }
  408. if (sStTime > sEdTime)
  409. {
  410. Application->MessageBox(FrmLang->lblQryDtErr->Caption.c_str(),//L"검색 시작일이 검색 종료일 보다 큽니다.",
  411. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  412. ActiveControl = dtStrDate1;
  413. return;
  414. }
  415. if (CbStrTm1->ItemIndex > CbEndTm1->ItemIndex)
  416. {
  417. Application->MessageBox(FrmLang->lblQryHourErr->Caption.c_str(),//L"시간대 시작시각이 시간대 종료시각 보다 큽니다.",
  418. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  419. ActiveControl = CbStrTm1;
  420. return;
  421. }
  422. FStTerm.printf(L"%02d0000", CbStrTm1->ItemIndex);
  423. FEdTerm.printf(L"%02d5959", CbEndTm1->ItemIndex);
  424. FStatType = CbStatType1->ItemIndex;
  425. String sTitle;
  426. sTitle.printf(L"%s - %s(%s~%s) %s ", cxPageControl1->Properties->ActivePage->Caption.c_str(),
  427. CbStatType1->Text.c_str(),
  428. sStTime.c_str(),
  429. sEdTime.c_str(),
  430. FLinkId.c_str());
  431. try
  432. {
  433. Application->ProcessMessages();
  434. LockWindowUpdate(Handle);
  435. TcxTabSheet *pSheet = CMM_AddTabSheet(PgTab, sTitle);
  436. if (!pSheet) return;
  437. IST00302 = new TIST00302(this, Handle, FLinkId, FStTime, FEdTime, FLinkLevel, FStatType, FStTerm, FEdTerm);
  438. IST00302->Parent = pSheet;
  439. IST00302->Show();
  440. PgTab->ActivePage = pSheet;
  441. pSheet = PgTab->ActivePage;
  442. m_pFormList->Add(IST00302);
  443. }
  444. __finally
  445. {
  446. LockWindowUpdate(0);
  447. }
  448. }
  449. //---------------------------------------------------------------------------
  450. void __fastcall TIST0030M::BtnSearch2Click(TObject *Sender)
  451. {
  452. Application->ProcessMessages();
  453. TSqlCursor sqlCrs((TControl*)BtnSearch);
  454. TcxGrid *pCxList = NULL;
  455. TcxGridTableView *pTvList = NULL;
  456. int nIdCol = -1;
  457. if (cxPageControl1->Properties->ActivePage->PageIndex == 0)
  458. {
  459. pCxList = FRAMELinkList1->CxList;
  460. pTvList = FRAMELinkList1->TvList;
  461. nIdCol = FRAMELinkList1->Column01->Index;
  462. FLinkLevel = 0;
  463. }
  464. else
  465. if (cxPageControl1->Properties->ActivePage->PageIndex == 1)
  466. {
  467. pCxList = FRAMEIfscList1->CxList;
  468. pTvList = FRAMEIfscList1->TvList;
  469. nIdCol = FRAMEIfscList1->Column01->Index;
  470. FLinkLevel = 1;
  471. }
  472. else
  473. if (cxPageControl1->Properties->ActivePage->PageIndex == 2)
  474. {
  475. pCxList = FRAMERoadList1->CxList;
  476. pTvList = FRAMERoadList1->TvList;
  477. nIdCol = FRAMERoadList1->Column01->Index;
  478. FLinkLevel = 2;
  479. }
  480. if (!pTvList) return;
  481. TcxDataController *pGDC = pTvList->DataController;
  482. int nIndex = pGDC->FocusedRecordIndex;
  483. if( nIndex < 0 )
  484. {
  485. Application->MessageBox(FrmLang->lblSelErr->Caption.c_str(),//L"링크를 먼저 선택 하세요.",
  486. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  487. ActiveControl = pCxList;
  488. return;
  489. }
  490. FLinkId = VarToStr(pGDC->Values[nIndex][nIdCol]);
  491. int nSelects = CMM_GetCheckCount(TvList, ColumnSel->Index);
  492. if (0 == nSelects)
  493. {
  494. Application->MessageBox(FrmLang->lblSelNoDate->Caption.c_str(),//L"검색 지정일을 선택하지 않았습니다.",
  495. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  496. ActiveControl = CxList;
  497. return;
  498. }
  499. bool bDateCheck = true;
  500. int nRowCnt = TvList->ViewData->RecordCount;
  501. for (int ii = 0; ii < nRowCnt; ii++)
  502. {
  503. TcxCustomGridRow* ARow = TvList->ViewData->Rows[ii];
  504. if (((bool)ARow->Values[ColumnSel->Index]))
  505. {
  506. try
  507. {
  508. if (VarIsNull(ARow->Values[Column01->Index]))
  509. {
  510. bDateCheck = false;
  511. break;
  512. }
  513. String sSelDay = ARow->Values[Column01->Index];
  514. sSelDay = StringReplace(sSelDay, DateSeparator, "", TReplaceFlags() << rfReplaceAll);
  515. if (sSelDay.Length() != 8)
  516. {
  517. bDateCheck = false;
  518. break;
  519. }
  520. }
  521. catch(Exception &e)
  522. {
  523. }
  524. }
  525. }
  526. if (!bDateCheck)
  527. {
  528. Application->MessageBox(FrmLang->lblSelDtErr->Caption.c_str(),//L"검색 지정일의 일자가 올바르지 않았습니다.",
  529. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  530. ActiveControl = CxList;
  531. return;
  532. }
  533. if (CbStrTm2->ItemIndex > CbEndTm2->ItemIndex)
  534. {
  535. Application->MessageBox(FrmLang->lblSelHourOver->Caption.c_str(),//L"시간대 시작시각이 시간대 종료시각 보다 큽니다.",
  536. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  537. ActiveControl = CbStrTm1;
  538. return;
  539. }
  540. FStTerm.printf(L"%02d0000", CbStrTm2->ItemIndex);
  541. FEdTerm.printf(L"%02d5959", CbEndTm2->ItemIndex);
  542. FStatType = CbStatType2->ItemIndex;
  543. String sTitle;
  544. sTitle.printf(L"%s - %s %s ", cxPageControl1->Properties->ActivePage->Caption.c_str(),
  545. CbStatType2->Text.c_str(),
  546. FLinkId.c_str());
  547. try
  548. {
  549. Application->ProcessMessages();
  550. LockWindowUpdate(Handle);
  551. TcxTabSheet *pSheet = CMM_AddTabSheet(PgTab, sTitle);
  552. if (!pSheet) return;
  553. IST00303 = new TIST00303(this, Handle, FLinkId, FStTime, FEdTime, FLinkLevel, FStatType, FStTerm, FEdTerm);
  554. IST00303->FSelDayCnt = 0;
  555. int nRowCnt = TvList->ViewData->RecordCount;
  556. for (int ii = 0; ii < nRowCnt; ii++)
  557. {
  558. TcxCustomGridRow* ARow = TvList->ViewData->Rows[ii];
  559. if (((bool)ARow->Values[ColumnSel->Index]))
  560. {
  561. try
  562. {
  563. TDateTime dt = VarToDateTime(ARow->Values[Column01->Index]);
  564. String sSelDay = dt.FormatString("yyyyMMdd");
  565. IST00303->FSelDay[IST00303->FSelDayCnt++] = sSelDay;
  566. }
  567. catch(Exception &e)
  568. {
  569. }
  570. }
  571. }
  572. IST00303->Parent = pSheet;
  573. IST00303->Show();
  574. PgTab->ActivePage = pSheet;
  575. pSheet = PgTab->ActivePage;
  576. m_pFormList->Add(IST00302);
  577. }
  578. __finally
  579. {
  580. LockWindowUpdate(0);
  581. }
  582. }
  583. //---------------------------------------------------------------------------
  584. void __fastcall TIST0030M::PgTabCanCloseEx(TObject *Sender, int ATabIndex, bool &ACanClose)
  585. {
  586. int nActiveIdx = ATabIndex;
  587. if (nActiveIdx <= 0) return;
  588. nActiveIdx--; // 첫번째 탭은 화면에 숨겨져 있다.
  589. m_pFormList->Delete(nActiveIdx);
  590. }
  591. //---------------------------------------------------------------------------