IST0060MF.cpp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "AppGlobalF.h"
  6. #include "ITSLangTransF.h"
  7. #pragma hdrstop
  8. #include "IST0060MF.h"
  9. #include "IST00601F.h"
  10. //---------------------------------------------------------------------------
  11. #pragma package(smart_init)
  12. #pragma link "cxButtons"
  13. #pragma link "cxCalendar"
  14. #pragma link "cxContainer"
  15. #pragma link "cxControls"
  16. #pragma link "cxDropDownEdit"
  17. #pragma link "cxEdit"
  18. #pragma link "cxGraphics"
  19. #pragma link "cxGroupBox"
  20. #pragma link "cxLabel"
  21. #pragma link "cxLookAndFeelPainters"
  22. #pragma link "cxLookAndFeels"
  23. #pragma link "cxMaskEdit"
  24. #pragma link "cxPC"
  25. #pragma link "cxPCdxBarPopupMenu"
  26. #pragma link "cxSpinEdit"
  27. #pragma link "cxSplitter"
  28. #pragma link "cxTextEdit"
  29. #pragma link "cxTimeEdit"
  30. #pragma link "dxSkinBlack"
  31. #pragma link "dxSkinBlue"
  32. #pragma link "dxSkinsCore"
  33. #pragma link "dxSkinscxPCPainter"
  34. #pragma resource "*.dfm"
  35. TIST0060M *IST0060M = NULL;
  36. //---------------------------------------------------------------------------
  37. __fastcall TIST0060M::TIST0060M(TComponent* Owner)
  38. : TForm(Owner)
  39. {
  40. LangTrans->Translate(this, ITSDb_GetConnection());
  41. ITSSkin_Load(this);
  42. CMM_LoadForm(g_sFormsDir, this);
  43. FTitle = Caption;//"프로세스 상태통계";
  44. m_pFormList = new TList();
  45. TsList01->TabVisible = false;
  46. }
  47. //---------------------------------------------------------------------------
  48. void __fastcall TIST0060M::CommClose()
  49. {
  50. try
  51. {
  52. for (int idx = m_pFormList->Count-1; idx >= 0; idx--)
  53. {
  54. m_pFormList->Delete(idx);
  55. }
  56. delete m_pFormList;
  57. CMM_SaveForm(g_sFormsDir, this);
  58. }
  59. catch(...)
  60. {
  61. }
  62. }
  63. //---------------------------------------------------------------------------
  64. void __fastcall TIST0060M::FormShow(TObject *Sender)
  65. {
  66. Refresh();
  67. FormInit();
  68. TmrShow->Enabled = true;
  69. }
  70. //---------------------------------------------------------------------------
  71. void __fastcall TIST0060M::FormInit()
  72. {
  73. DtStDate->Date = Now() - 1;
  74. DtEdDate->Date = Now() - 1;
  75. //DtStTime->EditValue = "00";//Now().FormatString("hh");
  76. //DtEdTime->EditValue = "23";//Now().FormatString("hh");
  77. DtStTime->Time = StrToDateTime("00:00");
  78. DtEdTime->Time = StrToDateTime("23:59");
  79. }
  80. //---------------------------------------------------------------------------
  81. void __fastcall TIST0060M::TmrShowTimer(TObject *Sender)
  82. {
  83. TmrShow->Enabled = false;
  84. }
  85. //---------------------------------------------------------------------------
  86. void __fastcall TIST0060M::RefreshData()
  87. {
  88. // 검색조건에 의한 링크 데이터 조회
  89. try
  90. {
  91. //SelListData();
  92. }
  93. __finally
  94. {
  95. }
  96. }
  97. //---------------------------------------------------------------------------
  98. void __fastcall TIST0060M::BtnSearchClick(TObject *Sender)
  99. {
  100. Application->ProcessMessages();
  101. TSqlCursor sqlCrs((TControl*)BtnSearch);
  102. #if 0
  103. FStDateTime = DtStDate->Date.FormatString("yyyymmdd") + DtStTime->Time.FormatString("hh");
  104. FEdDateTime = DtEdDate->Date.FormatString("yyyymmdd") + DtEdTime->Time.FormatString("hh");
  105. #else
  106. FStDateTime = DtStDate->Date.FormatString("yyyymmdd") + DtStTime->Time.FormatString("hhnn");
  107. FEdDateTime = DtEdDate->Date.FormatString("yyyymmdd") + DtEdTime->Time.FormatString("hhnn");
  108. #endif
  109. if (FStDateTime > FEdDateTime)
  110. {
  111. Application->MessageBox(FrmLang->lblQryDtErr->Caption.c_str(),//L"검색 시작시각이 검색 종료시각 보다 큽니다.",
  112. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  113. ActiveControl = DtStDate;
  114. return;
  115. }
  116. #if 0
  117. FStDateTime = FStDateTime + "0000";
  118. FEdDateTime = FEdDateTime + "5959";
  119. #else
  120. FStDateTime = FStDateTime + "00";
  121. FEdDateTime = FEdDateTime + "59";
  122. #endif
  123. FIdList = "";
  124. String sTitle = "[" + FStDateTime.SubString(1, 12) + "-" + FEdDateTime.SubString(1, 12) + "]";
  125. try
  126. {
  127. Application->ProcessMessages();
  128. LockWindowUpdate(Handle);
  129. TcxTabSheet *pSheet = CMM_AddTabSheet(PgTab, sTitle);
  130. if (!pSheet) return;
  131. IST00601 = new TIST00601(this, Handle, FStDateTime, FEdDateTime, FIdList);
  132. IST00601->Parent = pSheet;
  133. IST00601->Show();
  134. PgTab->ActivePage = pSheet;
  135. pSheet = PgTab->ActivePage;
  136. m_pFormList->Add(IST00601);
  137. }
  138. __finally
  139. {
  140. LockWindowUpdate(0);
  141. }
  142. }
  143. //---------------------------------------------------------------------------
  144. void __fastcall TIST0060M::BtnCloseClick(TObject *Sender)
  145. {
  146. Close();
  147. }
  148. //---------------------------------------------------------------------------
  149. void __fastcall TIST0060M::OnSubFormClose(TMessage Msg)
  150. {
  151. int nActiveIdx = PgTab->ActivePageIndex;
  152. if (nActiveIdx <= 0) return;
  153. LockWindowUpdate(Handle);
  154. TcxTabSheet *pSheet = PgTab->ActivePage;
  155. if (pSheet)
  156. {
  157. delete pSheet;
  158. }
  159. nActiveIdx--; // 첫번째 탭은 화면에 숨겨져 있다.
  160. m_pFormList->Delete(nActiveIdx);
  161. LockWindowUpdate(0);
  162. }
  163. //---------------------------------------------------------------------------
  164. void __fastcall TIST0060M::PgTabDblClick(TObject *Sender)
  165. {
  166. TPoint APoint;
  167. APoint = PgTab->MouseDownPos;
  168. if (PgTab->IndexOfTabAt(APoint.x, APoint.y) != -1)
  169. POST_MSG(Handle, WM_SUBFORM_CLOSE, 0, 0);
  170. }
  171. //---------------------------------------------------------------------------
  172. void __fastcall TIST0060M::FormClose(TObject *Sender, TCloseAction &Action)
  173. {
  174. CommClose();
  175. IST0060M = NULL;
  176. Action = caFree;
  177. }
  178. //---------------------------------------------------------------------------
  179. void __fastcall TIST0060M::PgTabCanCloseEx(TObject *Sender, int ATabIndex, bool &ACanClose)
  180. {
  181. int nActiveIdx = ATabIndex;
  182. if (nActiveIdx <= 0) return;
  183. nActiveIdx--; // 첫번째 탭은 화면에 숨겨져 있다.
  184. m_pFormList->Delete(nActiveIdx);
  185. }
  186. //---------------------------------------------------------------------------