FRMLoginF.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. //---------------------------------------------------------------------------
  2. #ifndef FrmLoginFH
  3. #define FrmLoginFH
  4. //---------------------------------------------------------------------------
  5. #include <vcl.h>
  6. #include <Classes.hpp>
  7. #include <Controls.hpp>
  8. #include <StdCtrls.hpp>
  9. #include <Buttons.hpp>
  10. #include <ExtCtrls.hpp>
  11. #include <jpeg.hpp>
  12. #include <Graphics.hpp>
  13. #include <Menus.hpp>
  14. //---------------------------------------------------------------------------
  15. #include "ITSDbF.h"
  16. #include "cxButtons.hpp"
  17. #include "cxContainer.hpp"
  18. #include "cxControls.hpp"
  19. #include "cxEdit.hpp"
  20. #include "cxGraphics.hpp"
  21. #include "cxLabel.hpp"
  22. #include "cxLookAndFeelPainters.hpp"
  23. #include "cxLookAndFeels.hpp"
  24. #include "dxSkinBlack.hpp"
  25. #include "dxSkinBlue.hpp"
  26. #include "dxSkinCaramel.hpp"
  27. #include "dxSkinCoffee.hpp"
  28. #include "dxSkinDarkRoom.hpp"
  29. #include "dxSkinDarkSide.hpp"
  30. #include "dxSkinFoggy.hpp"
  31. #include "dxSkinGlassOceans.hpp"
  32. #include "dxSkiniMaginary.hpp"
  33. #include "dxSkinLilian.hpp"
  34. #include "dxSkinLiquidSky.hpp"
  35. #include "dxSkinLondonLiquidSky.hpp"
  36. #include "dxSkinMcSkin.hpp"
  37. #include "dxSkinMoneyTwins.hpp"
  38. #include "dxSkinOffice2007Black.hpp"
  39. #include "dxSkinOffice2007Blue.hpp"
  40. #include "dxSkinOffice2007Green.hpp"
  41. #include "dxSkinOffice2007Pink.hpp"
  42. #include "dxSkinOffice2007Silver.hpp"
  43. #include "dxSkinOffice2010Black.hpp"
  44. #include "dxSkinOffice2010Blue.hpp"
  45. #include "dxSkinOffice2010Silver.hpp"
  46. #include "dxSkinsCore.hpp"
  47. #include "dxSkinSeven.hpp"
  48. #include "dxSkinSharp.hpp"
  49. #include "dxSkinSilver.hpp"
  50. #include "dxSkinStardust.hpp"
  51. #include <ADODB.hpp>
  52. #include <DB.hpp>
  53. //---------------------------------------------------------------------------
  54. //---------------------------------------------------------------------------
  55. #define USER_LOGIN_TRY_CNT 3
  56. typedef enum
  57. {
  58. LOGIN_OK = 0,
  59. LOGIN_ID_ERR,
  60. LOGIN_PSWD_ERR,
  61. LOGIN_DB_ERR,
  62. } EN_LOGIN;
  63. //---------------------------------------------------------------------------
  64. class TFRMLogin : public TForm
  65. {
  66. __published: // IDE-managed Components
  67. TPanel *Panel1;
  68. TCheckBox *ChkIdSave;
  69. TImage *Image1;
  70. TcxLabel *LbMessage;
  71. TcxLabel *cxLabel1;
  72. TEdit *EdUserID;
  73. TcxLabel *cxLabel2;
  74. TEdit *EdPswd;
  75. TImage *Image2;
  76. TLabel *Label1;
  77. TcxButton *BtnLogin;
  78. TcxButton *BtnPswdChnge;
  79. TcxButton *BtnClose;
  80. void __fastcall BtnCloseClick(TObject *Sender);
  81. void __fastcall BtnPswdChngeClick(TObject *Sender);
  82. void __fastcall BtnLoginClick(TObject *Sender);
  83. void __fastcall FormShow(TObject *Sender);
  84. void __fastcall EdUserIDKeyPress(TObject *Sender, char &Key);
  85. void __fastcall EdPswdKeyPress(TObject *Sender, char &Key);
  86. void __fastcall FormCreate(TObject *Sender);
  87. void __fastcall Image1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
  88. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  89. private: // User declarations
  90. public: // User declarations
  91. __fastcall TFRMLogin(TComponent* Owner);
  92. void __fastcall SetLocalSkin();
  93. int __fastcall GetUserPassword(String sUserID, String sPswd);
  94. String __fastcall GetLocalIp();
  95. String __fastcall GetPassword(String APswd);
  96. int m_nLoginTryCnt;
  97. String m_sUserName;
  98. String m_sUserID;
  99. String m_sUserRightID;
  100. String m_sUserRightName;
  101. String m_sLoginTime;
  102. bool m_bLogin;
  103. };
  104. //---------------------------------------------------------------------------
  105. extern PACKAGE TFRMLogin *FRMLogin;
  106. //---------------------------------------------------------------------------
  107. #endif