FRMLoginF.h 2.7 KB

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