#pragma once

#include "stdafx.h"
#include "CaplFaultMgr.h"
#include "resource.h"

// CGetRefusalDlg dialog

class CGetRefusalDlg : public CaplResizableDialog
{
	DECLARE_DYNAMIC(CGetRefusalDlg)

public:
	CGetRefusalDlg(CaplAPI *api, CaplFaultMgr *mgr, CWnd* pParent = NULL);   // standard constructor
	virtual ~CGetRefusalDlg();

// Dialog Data
	enum { IDD = IDD_GET_REFUSAL };

	CaplAPI *m_api;
	CaplFaultMgr *m_FaultMgr;
	CaplInstance *m_ciParentRef;
	CaplInstance *m_ciChildRef;
	CStringArray m_saSQLparts;	

	CSortListCtrl m_list;
	CaplButton m_ok_btn;
	CaplButton m_cancel_btn;
	CaplButton m_search_btn;

	void InitList();
	void InitBtns();
	void ShowRefusal(aplExtent &aeRefusal);
	bool CheckForLoop(CaplInstance *ciRef);

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

	DECLARE_MESSAGE_MAP()

public:
	afx_msg void OnBnClickedSearch();
	afx_msg void OnSize(UINT nType, int cx, int cy);
};
