IST0060MF.cpp 5.9 KB

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