ITS0030MF.cpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 link "dxSkinMcSkin"
  33. #pragma resource "*.dfm"
  34. TITS0030M *ITS0030M = NULL;
  35. //---------------------------------------------------------------------------
  36. __fastcall TITS0030M::TITS0030M(TComponent* Owner)
  37. : TForm(Owner)
  38. {
  39. LangTrans->Translate(this, ITSDb_GetConnection());
  40. ITSSkin_Load(this);
  41. CMM_LoadForm(g_sFormsDir, this);
  42. cxPageControl1->Properties->ActivePage = cxTabSheet1;
  43. }
  44. //---------------------------------------------------------------------------
  45. void __fastcall TITS0030M::CommClose()
  46. {
  47. try
  48. {
  49. ItsIncidentManager->FAutoLists.RemoveAll();
  50. ItsIncidentManager->FVmsLists.RemoveAll();
  51. CMM_SaveForm(g_sFormsDir, this);
  52. }
  53. catch(...)
  54. {
  55. }
  56. }
  57. //---------------------------------------------------------------------------
  58. void __fastcall TITS0030M::FormInit()
  59. {
  60. FRAMEIncidentRegist1->PnlTitle->Color = (TColor)0x00ACACFF;
  61. FRAMEIncidentProcess1->PnlTitle->Color = (TColor)0x000080FF;
  62. FRAMEIncidentProcess1->PnlVms->Color = clBlack;
  63. FRAMEIncidentEnd1->PnlTitle->Color = (TColor)0x0049BE50;
  64. }
  65. //---------------------------------------------------------------------------
  66. void __fastcall TITS0030M::FormShow(TObject *Sender)
  67. {
  68. Refresh();
  69. FormInit();
  70. TmrShow->Enabled = true;
  71. }
  72. //---------------------------------------------------------------------------
  73. void __fastcall TITS0030M::TmrShowTimer(TObject *Sender)
  74. {
  75. TmrShow->Enabled = false;
  76. BtnSearchClick((TObject*)BtnSearch);
  77. }
  78. //---------------------------------------------------------------------------
  79. void __fastcall TITS0030M::BtnSearchClick(TObject *Sender)
  80. {
  81. Application->ProcessMessages();
  82. TSqlCursor sqlCrs((TControl*)BtnSearch);
  83. RefreshData();
  84. }
  85. //---------------------------------------------------------------------------
  86. void __fastcall TITS0030M::RefreshData()
  87. {
  88. SelListData();
  89. }
  90. //---------------------------------------------------------------------------
  91. void __fastcall TITS0030M::SelListData()
  92. {
  93. FRAMEIncidentRegist1->UpdateList();
  94. FRAMEIncidentRegist1->UpdateAutoList();
  95. FRAMEIncidentProcess1->UpdateList();
  96. //FRAMEIncidentProcess1->UpdateAutoList();
  97. FRAMEIncidentEnd1->UpdateList();
  98. }
  99. //---------------------------------------------------------------------------
  100. void __fastcall TITS0030M::BtnCloseClick(TObject *Sender)
  101. {
  102. Close();
  103. }
  104. //---------------------------------------------------------------------------
  105. void __fastcall TITS0030M::FormClose(TObject *Sender, TCloseAction &Action)
  106. {
  107. try
  108. {
  109. if (FrmIncidVmsInfo)
  110. {
  111. FrmIncidVmsInfo->Close();
  112. FrmIncidVmsInfo = NULL;
  113. }
  114. }
  115. catch(...)
  116. {
  117. }
  118. CommClose();
  119. ITS0030M = NULL;
  120. Action = caFree;
  121. }
  122. //---------------------------------------------------------------------------
  123. void __fastcall TITS0030M::cxPageControl1PageChanging(TObject *Sender, TcxTabSheet *NewPage, bool &AllowChange)
  124. {
  125. try
  126. {
  127. if (FrmIncidVmsInfo)
  128. {
  129. FrmIncidVmsInfo->Close();
  130. FrmIncidVmsInfo = NULL;
  131. }
  132. }
  133. catch(...)
  134. {
  135. }
  136. switch(NewPage->PageIndex)
  137. {
  138. case 0 :
  139. FRAMEIncidentRegist1->UpdateList();
  140. FRAMEIncidentRegist1->UpdateAutoList();
  141. break;
  142. case 1 :
  143. FRAMEIncidentProcess1->UpdateList();
  144. //FRAMEIncidentProcess1->UpdateAutoList();
  145. break;
  146. case 2 :
  147. FRAMEIncidentEnd1->UpdateList();
  148. break;
  149. }
  150. }
  151. //---------------------------------------------------------------------------