IST0030MF.cpp 20 KB

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