FRMLoginF.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 <ADODB.hpp>
  17. #include <DB.hpp>
  18. #include "cxButtons.hpp"
  19. #include "cxContainer.hpp"
  20. #include "cxControls.hpp"
  21. #include "cxEdit.hpp"
  22. #include "cxGraphics.hpp"
  23. #include "cxLabel.hpp"
  24. #include "cxLookAndFeelPainters.hpp"
  25. #include "cxLookAndFeels.hpp"
  26. #include "dxSkinBlack.hpp"
  27. #include "dxSkinBlue.hpp"
  28. #include "dxSkinsCore.hpp"
  29. //---------------------------------------------------------------------------
  30. #define USER_LOGIN_TRY_CNT 3
  31. typedef enum
  32. {
  33. LOGIN_OK = 0,
  34. LOGIN_ID_ERR,
  35. LOGIN_PSWD_ERR,
  36. LOGIN_DB_ERR,
  37. } EN_LOGIN;
  38. //---------------------------------------------------------------------------
  39. class TFRMLogin : public TForm
  40. {
  41. __published: // IDE-managed Components
  42. TPanel *Panel1;
  43. TEdit *EdUserID;
  44. TEdit *EdPswd;
  45. TCheckBox *ChkIdSave;
  46. TImage *Image1;
  47. TcxButton *BtnLogin;
  48. TcxButton *BtnPswdChnge;
  49. TcxButton *BtnClose;
  50. TcxLabel *cxLabel1;
  51. TcxLabel *cxLabel2;
  52. TcxLabel *LbMessage;
  53. void __fastcall BtnCloseClick(TObject *Sender);
  54. void __fastcall BtnPswdChngeClick(TObject *Sender);
  55. void __fastcall BtnLoginClick(TObject *Sender);
  56. void __fastcall FormShow(TObject *Sender);
  57. void __fastcall EdUserIDKeyPress(TObject *Sender, char &Key);
  58. void __fastcall EdPswdKeyPress(TObject *Sender, char &Key);
  59. void __fastcall FormCreate(TObject *Sender);
  60. void __fastcall Image1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
  61. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  62. private: // User declarations
  63. public: // User declarations
  64. __fastcall TFRMLogin(TComponent* Owner);
  65. void __fastcall SetLocalSkin();
  66. int __fastcall GetUserPassword(String sUserID, String sPswd);
  67. String __fastcall GetLocalIp();
  68. String __fastcall GetPassword(String APswd);
  69. int m_nLoginTryCnt;
  70. String m_sUserName;
  71. String m_sUserID;
  72. String m_sUserRightID;
  73. String m_sUserRightName;
  74. String m_sLoginTime;
  75. bool m_bLogin;
  76. };
  77. //---------------------------------------------------------------------------
  78. extern PACKAGE TFRMLogin *FRMLogin;
  79. //---------------------------------------------------------------------------
  80. #endif