#pragma once

#ifdef ENABLE_ASH_MO

#include "afxwin.h"
#include <apl_api.h>
#include <apl_gui.h>

// CAshMoImportDialog dialog

void WriteAshMoDBLog(CaplAPI *m_api,LPCSTR txt);

class CAshMoImportDialog : public CaplResizableDialog
{
	DECLARE_DYNAMIC(CAshMoImportDialog)

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

	CaplAPI *m_api;
	CaplInstance *m_instEkpsSystem;
	CString m_sRarPath;
	CString m_sUvedomlenie;
	CString m_sTempPath;

	bool m_bOnlyVerify;  // Не грузить - только проверять

	bool Init(); // Загрузка и проверка первоначальных данных
	bool AshMoImportPackage();
	bool AshMoVerifyPackage();

	bool GenerateUveoml(bool bResult, CString sFileName, CString sRecipient, CString sPacageId, CString sPackageVer, CString sErrors);


	void AddLog(LPCTSTR txt, int bShowMsg=0);

// Dialog Data
	enum { IDD = IDD_ASH_MO_IMPORT };

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

	DECLARE_MESSAGE_MAP()
public:
	CEdit m_log_ctrl;
	virtual BOOL OnInitDialog();
	CaplButton m_cancel_btn;
	CaplButton m_start_btn;
	afx_msg void OnBnClickedStart();
	CButton m_use_dig_sign;
protected:
	virtual void OnCancel();
};

#endif