WBH0010MF.cpp 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include <DateUtils.hpp>
  4. #include "ITSSkinF.h"
  5. #include "ITSUtilF.h"
  6. #include "AppGlobalF.h"
  7. #pragma hdrstop
  8. #include "WBH0010MF.h"
  9. #include "WBH00101F.h"
  10. //---------------------------------------------------------------------------
  11. #pragma package(smart_init)
  12. #pragma link "FRAME_WebUserListF"
  13. #pragma link "cxButtons"
  14. #pragma link "cxCalendar"
  15. #pragma link "cxContainer"
  16. #pragma link "cxControls"
  17. #pragma link "cxDropDownEdit"
  18. #pragma link "cxEdit"
  19. #pragma link "cxGraphics"
  20. #pragma link "cxGroupBox"
  21. #pragma link "cxLabel"
  22. #pragma link "cxLookAndFeelPainters"
  23. #pragma link "cxLookAndFeels"
  24. #pragma link "cxMaskEdit"
  25. #pragma link "cxPC"
  26. #pragma link "cxPCdxBarPopupMenu"
  27. #pragma link "cxSpinEdit"
  28. #pragma link "cxSplitter"
  29. #pragma link "cxTextEdit"
  30. #pragma link "cxTimeEdit"
  31. #pragma link "dxSkinBlack"
  32. #pragma link "dxSkinBlue"
  33. #pragma link "dxSkinsCore"
  34. #pragma link "dxSkinscxPCPainter"
  35. #pragma link "dxSkinMcSkin"
  36. #pragma resource "*.dfm"
  37. TWBH0010M *WBH0010M = NULL;
  38. //---------------------------------------------------------------------------
  39. __fastcall TWBH0010M::TWBH0010M(TComponent* Owner)
  40. : TForm(Owner)
  41. {
  42. ITSSkin_Load(this);
  43. CMM_LoadForm(g_sFormsDir, this);
  44. FTitle = "홈페이지 관리자 이력조회";
  45. m_pFormList = new TList();
  46. TsList01->TabVisible = false;
  47. FRAMEWebUserList1->PnlTop->Visible = true;
  48. FRAMEWebUserList1->PnlBottom->Visible = false;
  49. FRAMEWebUserList1->ColumnSel->Visible = true;
  50. }
  51. //---------------------------------------------------------------------------
  52. void __fastcall TWBH0010M::CommClose()
  53. {
  54. try
  55. {
  56. for (int idx = m_pFormList->Count-1; idx >= 0; idx--)
  57. {
  58. m_pFormList->Delete(idx);
  59. }
  60. delete m_pFormList;
  61. CMM_SaveForm(g_sFormsDir, this);
  62. }
  63. catch(...)
  64. {
  65. }
  66. }
  67. //---------------------------------------------------------------------------
  68. void __fastcall TWBH0010M::FormShow(TObject *Sender)
  69. {
  70. Refresh();
  71. FormInit();
  72. TmrShow->Enabled = true;
  73. }
  74. //---------------------------------------------------------------------------
  75. void __fastcall TWBH0010M::FormInit()
  76. {
  77. DtStDate->Date = StartOfTheMonth(Now());//Now() - 1;
  78. DtEdDate->Date = Now();//Now() - 1;
  79. //DtEdTime->EditValue = Now().FormatString("hh");
  80. DtStTime->Time = StrToDateTime("00:00");
  81. DtEdTime->Time = StrToDateTime("23:59");
  82. }
  83. //---------------------------------------------------------------------------
  84. void __fastcall TWBH0010M::TmrShowTimer(TObject *Sender)
  85. {
  86. TmrShow->Enabled = false;
  87. FRAMEWebUserList1->UpdateList(true);
  88. BtnSearch->SetFocus();
  89. }
  90. //---------------------------------------------------------------------------
  91. void __fastcall TWBH0010M::RefreshData()
  92. {
  93. // 검색조건에 의한 링크 데이터 조회
  94. try
  95. {
  96. //SelListData();
  97. }
  98. __finally
  99. {
  100. }
  101. }
  102. //---------------------------------------------------------------------------
  103. void __fastcall TWBH0010M::BtnSearchClick(TObject *Sender)
  104. {
  105. Application->ProcessMessages();
  106. TSqlCursor sqlCrs((TControl*)BtnSearch);
  107. FStDateTime = DtStDate->Date.FormatString("yyyymmdd") + DtStTime->Time.FormatString("hhnn");
  108. FEdDateTime = DtEdDate->Date.FormatString("yyyymmdd") + DtEdTime->Time.FormatString("hhnn");
  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. FStDateTime = FStDateTime + "00";
  117. FEdDateTime = FEdDateTime + "59";
  118. FIdList = "";
  119. int nSelects = CMM_GetSelectCount(FRAMEWebUserList1->TvList, FRAMEWebUserList1->ColumnSel->Index, FRAMEWebUserList1->Column01->Index, FIdList);
  120. if (0 == nSelects)
  121. {
  122. Application->MessageBox(FrmLang->lblSelLstErr->Caption.c_str(),//L"검색 목록을 선택하지 않았습니다.",
  123. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  124. FRAMEWebUserList1->CxList->SetFocus();
  125. return;
  126. }
  127. String sTitle = FIdList;
  128. try
  129. {
  130. Application->ProcessMessages();
  131. LockWindowUpdate(Handle);
  132. TcxTabSheet *pSheet = CMM_AddTabSheet(PgTab, sTitle);
  133. if (!pSheet) return;
  134. WBH00101 = new TWBH00101(this, Handle, FStDateTime, FEdDateTime, FIdList);
  135. WBH00101->Parent = pSheet;
  136. WBH00101->Show();
  137. PgTab->ActivePage = pSheet;
  138. pSheet = PgTab->ActivePage;
  139. m_pFormList->Add(WBH00101);
  140. }
  141. __finally
  142. {
  143. LockWindowUpdate(0);
  144. }
  145. }
  146. //---------------------------------------------------------------------------
  147. void __fastcall TWBH0010M::BtnCloseClick(TObject *Sender)
  148. {
  149. Close();
  150. }
  151. //---------------------------------------------------------------------------
  152. void __fastcall TWBH0010M::OnSubFormClose(TMessage Msg)
  153. {
  154. int nActiveIdx = PgTab->ActivePageIndex;
  155. if (nActiveIdx <= 0) return;
  156. LockWindowUpdate(Handle);
  157. TcxTabSheet *pSheet = PgTab->ActivePage;
  158. if (pSheet)
  159. {
  160. delete pSheet;
  161. }
  162. nActiveIdx--; // 첫번째 탭은 화면에 숨겨져 있다.
  163. m_pFormList->Delete(nActiveIdx);
  164. LockWindowUpdate(0);
  165. }
  166. //---------------------------------------------------------------------------
  167. void __fastcall TWBH0010M::PgTabDblClick(TObject *Sender)
  168. {
  169. TPoint APoint;
  170. APoint = PgTab->MouseDownPos;
  171. if (PgTab->IndexOfTabAt(APoint.x, APoint.y) != -1)
  172. POST_MSG(Handle, WM_SUBFORM_CLOSE, 0, 0);
  173. }
  174. //---------------------------------------------------------------------------
  175. void __fastcall TWBH0010M::FormClose(TObject *Sender, TCloseAction &Action)
  176. {
  177. CommClose();
  178. WBH0010M = NULL;
  179. Action = caFree;
  180. }
  181. //---------------------------------------------------------------------------
  182. void __fastcall TWBH0010M::PgTabCanCloseEx(TObject *Sender, int ATabIndex, bool &ACanClose)
  183. {
  184. int nActiveIdx = ATabIndex;
  185. if (nActiveIdx <= 0) return;
  186. nActiveIdx--; // 첫번째 탭은 화면에 숨겨져 있다.
  187. m_pFormList->Delete(nActiveIdx);
  188. }
  189. //---------------------------------------------------------------------------
  190. void __fastcall TWBH0010M::FormCloseQuery(TObject *Sender, bool &CanClose)
  191. {
  192. FRAMEWebUserList1->OnCloseQuery(CanClose);
  193. }
  194. //---------------------------------------------------------------------------