#if !defined(AFX_EDITCARD_H__28EFB6D7_DF81_4A8E_A384_243F91FE0997__INCLUDED_)
#define AFX_EDITCARD_H__28EFB6D7_DF81_4A8E_A384_243F91FE0997__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditCard.h : header file
//
#include <afxtempl.h>

/////////////////////////////////////////////////////////////////////////////
// CEditCard dialog

class CEditCard : public CDialog
{
// Construction
public:
	CEditCard(CWnd* pParent = NULL);   // standard constructor
	CEditCard(IApplication *pApp);
	//Added by Bhaba, Dated:02/03/2022
	~CEditCard();
	//End
	DWORD GetAccessLevelIDFromACName(CString stAcclName);
// Dialog Data
	//{{AFX_DATA(CEditCard)
	enum { IDD = IDD_CARD_EDIT };
	CEdit	m_Cnt_newCard;
	CListBox	m_Ex_MulAcclList;
	CListBox	m_Mul_AcclList;
	CListBox	m_MulAccessLevelList;		//WUR
	CString		m_szMLActivationDate;		//WUR
	CString		m_szMLExpirationDate;		//WUR
	VARIANT_BOOL    m_bAccessTypeMulExpiry; //WUR
	CEdit	m_Cnt_ExStatus;
	CEdit	m_cnt_ExCard;
	CEdit	m_Cnt_ExExpire;
	CEdit	m_Cnt_ExCH;
	CEdit	m_Cnt_ExActive;
	CEdit	m_cnt_ExAccl;
	CComboBox	m_NewStatus;
	CComboBox	m_NewCHList;
	CComboBox	m_AcctList;
	CComboBox	m_AcctIDList;
	CComboBox	m_SubAcctList;
	CComboBox	m_NewAcclList;
	CComboBox	m_CardList;
	CString	m_ExAccl;
	CString	m_ExActive;
	CString	m_ExCardno;
	CString	m_ExCH;
	CString	m_ExExpire;
	CString	m_ExStatus;
	CString	m_NewCard;
	CString	m_exPIN1;
	CString	m_exPIN2;
	CString	m_NewActivationDate;
	CString	m_NewExpirationDate;
	CString	m_NewPIN1;
	CString	m_NewPIN2;
	BOOL	m_bExNXLimited;
	BOOL	m_bExNXTempCard;
	int		m_iExNXCardType;
	int		m_nExNXLimit;
	int		m_nNewNXLimit;
	int		m_iNewNXCardType;
	BOOL	m_bNewNXLimited;
	BOOL	m_bNewNXTempCard;
	int		m_nPRO3000CardType2;
	int		m_nPRO3000CardType3;
	int		m_nPRO3000CardTypeVIP1;
	int		m_nPRO3000CardTypeVIP2;
	int		m_MaxAllowedAccesslevel;  //WPACT-5689
	BOOL    m_blALActivationDate;
	time_t  dtDbActivationDate;
	//}}AFX_DATA

	struct CARD_MALINFO
	{
		int		inAccessLevelID;
		time_t	ALActivationDate;
		time_t	ALExpirationDate;
	};

//WPACT-4867 API modification for Multiple AL with expiry check //Mitesh Patel
	struct ALEXPIRYDATA
	{
		CString	sAccessLevel;
		CString	sActivationDate;
		CString	sExpirationDate;
	};

	CMap<CString, LPCTSTR, ALEXPIRYDATA, ALEXPIRYDATA> mapALExpiryDate;
	CMap<CString, LPCTSTR, CARD_MALINFO, CARD_MALINFO> mapStrMALAccExpiry;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEditCard)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CEditCard)
	virtual BOOL OnInitDialog();
	afx_msg void OnEdit();
	afx_msg void OnSelchangeAcctlist();
	afx_msg void OnSelchangeSubAcctlist();
	afx_msg void OnSelchangeCardlist();
	afx_msg void OnClickLstSelectedAccessLevel();
	afx_msg void OnSetALInfo();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	IApplicationPtr	pApplication;
	ICardPtr	pCard;
	int iAccessType;
	void LoadAccounts();
	void LoadSubAccounts();
	void LoadCardsList();
	void GetCardDetails();
	void LoadAccessLevels();
	void LoadCardHolders();
	CString FormatDate(CTime time);
	bool DateValidation(COleDateTime ActDate, COleDateTime ExpDate);
	time_t GetTimeData(CString strDate);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_EDITCARD_H__28EFB6D7_DF81_4A8E_A384_243F91FE0997__INCLUDED_)
