#pragma once
#include "resource.h"
#include "RefDocumentsChildDlg.h"

// CRefResultsChildDlg dialog

class CRefDocumentsChildDlg;
class CRefResultsChildDlg : public CaplTranslateDialog
{
	DECLARE_DYNAMIC(CRefResultsChildDlg)

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

// Dialog Data
	enum { IDD = IDD_REF_RESULTS };

	CaplButton m_choose_rekl_doc;
	CaplButton m_clear_rekl_doc;
	CaplButton m_create_rekl;
	CaplButton m_show_rekl;

	CString m_sArrangm;
	CString m_sDispose;
	CString m_sResult;
	CString m_sReklDoc;
	CString m_sReklNum;

	CaplAPI *m_api;
	CaplInstance *m_ciRef;
	CaplInstance *m_ciReklDoc;

	CRefDocumentsChildDlg *m_pDocDlg;

	void SetReadOnly();

	void ClearRekl();
	void InitBtns();
	void FillDataBase();
	void SetDoc(CaplInstance *inst);
	void SaveRefData(CaplInstance *ciRef);

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

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedChooseRekl();
	afx_msg void OnBnClickedClearRekl();
	afx_msg void OnBnClickedCreateRekl();
	afx_msg void OnBnClickedShowRekl();
};
