ITS0030MF.cpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "ITSDbF.h"
  6. #include "AppGlobalF.h"
  7. #include "CDSCodeF.h"
  8. #include "CDSNodeF.h"
  9. #include "CDSLinkF.h"
  10. #include "CDSIfscF.h"
  11. #include "CDSRoadF.h"
  12. #include "ITSLangTransF.h"
  13. #pragma hdrstop
  14. #include "ITS0030MF.h"
  15. #include "FrmIncidVmsInfoF.h"
  16. //---------------------------------------------------------------------------
  17. #pragma package(smart_init)
  18. #pragma link "FRAME_IncidentRegistF"
  19. #pragma link "FRAME_IncidentProcessF"
  20. #pragma link "FRAME_IncidentEndF"
  21. #pragma link "cxButtons"
  22. #pragma link "cxControls"
  23. #pragma link "cxGraphics"
  24. #pragma link "cxLookAndFeelPainters"
  25. #pragma link "cxLookAndFeels"
  26. #pragma link "cxPC"
  27. #pragma link "cxPCdxBarPopupMenu"
  28. #pragma link "dxSkinBlack"
  29. #pragma link "dxSkinBlue"
  30. #pragma link "dxSkinsCore"
  31. #pragma link "dxSkinscxPCPainter"
  32. #pragma resource "*.dfm"
  33. TITS0030M *ITS0030M = NULL;
  34. //---------------------------------------------------------------------------
  35. __fastcall TITS0030M::TITS0030M(TComponent* Owner)
  36. : TForm(Owner)
  37. {
  38. LangTrans->Translate(this, ITSDb_GetConnection());
  39. ITSSkin_Load(this);
  40. CMM_LoadForm(g_sFormsDir, this);
  41. cxPageControl1->Properties->ActivePage = cxTabSheet1;
  42. }
  43. //---------------------------------------------------------------------------
  44. void __fastcall TITS0030M::CommClose()
  45. {
  46. try
  47. {
  48. ItsIncidentManager->FAutoLists.RemoveAll();
  49. ItsIncidentManager->FVmsLists.RemoveAll();
  50. CMM_SaveForm(g_sFormsDir, this);
  51. }
  52. catch(...)
  53. {
  54. }
  55. }
  56. //---------------------------------------------------------------------------
  57. void __fastcall TITS0030M::FormInit()
  58. {
  59. FRAMEIncidentRegist1->PnlTitle->Color = (TColor)0x00ACACFF;
  60. FRAMEIncidentProcess1->PnlTitle->Color = (TColor)0x000080FF;
  61. FRAMEIncidentProcess1->PnlVms->Color = clBlack;
  62. FRAMEIncidentEnd1->PnlTitle->Color = (TColor)0x0049BE50;
  63. }
  64. //---------------------------------------------------------------------------
  65. void __fastcall TITS0030M::FormShow(TObject *Sender)
  66. {
  67. Refresh();
  68. FormInit();
  69. TmrShow->Enabled = true;
  70. }
  71. //---------------------------------------------------------------------------
  72. void __fastcall TITS0030M::TmrShowTimer(TObject *Sender)
  73. {
  74. TmrShow->Enabled = false;
  75. BtnSearchClick((TObject*)BtnSearch);
  76. }
  77. //---------------------------------------------------------------------------
  78. void __fastcall TITS0030M::BtnSearchClick(TObject *Sender)
  79. {
  80. Application->ProcessMessages();
  81. TSqlCursor sqlCrs((TControl*)BtnSearch);
  82. RefreshData();
  83. }
  84. //---------------------------------------------------------------------------
  85. void __fastcall TITS0030M::RefreshData()
  86. {
  87. SelListData();
  88. }
  89. //---------------------------------------------------------------------------
  90. void __fastcall TITS0030M::SelListData()
  91. {
  92. FRAMEIncidentRegist1->UpdateList();
  93. FRAMEIncidentRegist1->UpdateAutoList();
  94. FRAMEIncidentProcess1->UpdateList();
  95. //FRAMEIncidentProcess1->UpdateAutoList();
  96. FRAMEIncidentEnd1->UpdateList();
  97. }
  98. //---------------------------------------------------------------------------
  99. void __fastcall TITS0030M::BtnCloseClick(TObject *Sender)
  100. {
  101. Close();
  102. }
  103. //---------------------------------------------------------------------------
  104. void __fastcall TITS0030M::FormClose(TObject *Sender, TCloseAction &Action)
  105. {
  106. try
  107. {
  108. if (FrmIncidVmsInfo)
  109. {
  110. FrmIncidVmsInfo->Close();
  111. FrmIncidVmsInfo = NULL;
  112. }
  113. }
  114. catch(...)
  115. {
  116. }
  117. CommClose();
  118. ITS0030M = NULL;
  119. Action = caFree;
  120. }
  121. //---------------------------------------------------------------------------
  122. void __fastcall TITS0030M::cxPageControl1PageChanging(TObject *Sender, TcxTabSheet *NewPage, bool &AllowChange)
  123. {
  124. try
  125. {
  126. if (FrmIncidVmsInfo)
  127. {
  128. FrmIncidVmsInfo->Close();
  129. FrmIncidVmsInfo = NULL;
  130. }
  131. }
  132. catch(...)
  133. {
  134. }
  135. switch(NewPage->PageIndex)
  136. {
  137. case 0 :
  138. FRAMEIncidentRegist1->UpdateList();
  139. FRAMEIncidentRegist1->UpdateAutoList();
  140. break;
  141. case 1 :
  142. FRAMEIncidentProcess1->UpdateList();
  143. //FRAMEIncidentProcess1->UpdateAutoList();
  144. break;
  145. case 2 :
  146. FRAMEIncidentEnd1->UpdateList();
  147. break;
  148. }
  149. }
  150. //---------------------------------------------------------------------------