//---------------------------------------------------------------------------

#ifndef FrmLoginFH
#define FrmLoginFH
//---------------------------------------------------------------------------

#include <vcl.h>
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include <jpeg.hpp>
#include <Graphics.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
#include "ITSDbF.h"
#include "cxButtons.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxEdit.hpp"
#include "cxGraphics.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinCaramel.hpp"
#include "dxSkinCoffee.hpp"
#include "dxSkinDarkRoom.hpp"
#include "dxSkinDarkSide.hpp"
#include "dxSkinFoggy.hpp"
#include "dxSkinGlassOceans.hpp"
#include "dxSkiniMaginary.hpp"
#include "dxSkinLilian.hpp"
#include "dxSkinLiquidSky.hpp"
#include "dxSkinLondonLiquidSky.hpp"
#include "dxSkinMcSkin.hpp"
#include "dxSkinMoneyTwins.hpp"
#include "dxSkinOffice2007Black.hpp"
#include "dxSkinOffice2007Blue.hpp"
#include "dxSkinOffice2007Green.hpp"
#include "dxSkinOffice2007Pink.hpp"
#include "dxSkinOffice2007Silver.hpp"
#include "dxSkinOffice2010Black.hpp"
#include "dxSkinOffice2010Blue.hpp"
#include "dxSkinOffice2010Silver.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinSeven.hpp"
#include "dxSkinSharp.hpp"
#include "dxSkinSilver.hpp"
#include "dxSkinStardust.hpp"
#include <ADODB.hpp>
#include <DB.hpp>
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#define     USER_LOGIN_TRY_CNT      3
typedef enum
{
    LOGIN_OK        = 0,
    LOGIN_ID_ERR,
    LOGIN_PSWD_ERR,
    LOGIN_DB_ERR,
} EN_LOGIN;

//---------------------------------------------------------------------------
class TFRMLogin : public TForm
{
__published:	// IDE-managed Components
    TPanel *Panel1;
    TCheckBox *ChkIdSave;
    TImage *Image1;
    TcxLabel *LbMessage;
    TcxLabel *cxLabel1;
    TEdit *EdUserID;
    TcxLabel *cxLabel2;
    TEdit *EdPswd;
    TImage *Image2;
    TLabel *Label1;
    TcxButton *BtnLogin;
    TcxButton *BtnPswdChnge;
    TcxButton *BtnClose;
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall BtnPswdChngeClick(TObject *Sender);
    void __fastcall BtnLoginClick(TObject *Sender);
    void __fastcall FormShow(TObject *Sender);
    void __fastcall EdUserIDKeyPress(TObject *Sender, char &Key);
    void __fastcall EdPswdKeyPress(TObject *Sender, char &Key);
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall Image1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
private:	// User declarations

public:		// User declarations
    __fastcall TFRMLogin(TComponent* Owner);

	void __fastcall SetLocalSkin();
    int  __fastcall GetUserPassword(String sUserID, String sPswd);
    String __fastcall GetLocalIp();
    String __fastcall GetPassword(String APswd);

    int     m_nLoginTryCnt;

	String  m_sUserName;
	String  m_sUserID;
	String  m_sUserRightID;
	String  m_sUserRightName;
    String  m_sLoginTime;

    bool    m_bLogin;
};
//---------------------------------------------------------------------------
extern PACKAGE TFRMLogin *FRMLogin;
//---------------------------------------------------------------------------
#endif
