WBH0010MF.cpp 6.3 KB

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