#pragma once
#include "afxcmn.h"
#include "apl_gui.h"
#include "afxwin.h"
#include "Resource.h"
#include "apl_api.h"


// CDlgADProperies dialog

class CDlgADProperies : public CaplTranslateDialog
{
	DECLARE_DYNAMIC(CDlgADProperies)

public:
	CDlgADProperies(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgADProperies();

// Dialog Data
	enum { IDD = IDD_AD_PROPERTIES };

	void MakeList();

	CaplAPI *m_api;

	CaplStrStrMap m_listDomainServer;
	CaplInstance *m_org4create;
	CaplInstance *m_userGroup4create;

	void CheckControls();
	bool m_PwdChanged;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	CListCtrl m_CtrlListDomainServers;
	afx_msg void OnBnClickedServersAdd();
	afx_msg void OnBnClickedServersDel();
	afx_msg void OnBnClickedServersEdit();
	virtual BOOL OnInitDialog();
	afx_msg void OnBnClickedOk();
	CaplButton m_ok_btn;
	CaplButton m_cancel_btn;
	CaplButton m_add_btn;
	CaplButton m_edit_btn;
	CaplButton m_del_btn;
	BOOL m_AutoCreateUser;
	CString m_OrgName4Create;
	CString m_UserNameGroup4Create;
	CEdit m_CtrlDomainUser;
	CEdit m_CtrlDomainPwd;
	CEdit m_CtrlDomainGroupe;
	CButton m_BtnSelUserGroup;
	CButton m_BtnDelUserGroup;
	CButton m_BtnDelOrg;
	CButton m_BtnSelOrg;
	afx_msg void OnNMDblclkListServers(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedSelOrg();
	afx_msg void OnBnClickedDelOrg();
	afx_msg void OnBnClickedSelUsergroup();
	afx_msg void OnBnClickedDelUsergroup();
	afx_msg void OnBnClickedChkAutoCreateUser();
	afx_msg void OnEnChangePassword();
	afx_msg void OnBnClickedTestDomainUser();
};
