#if !defined(AFX_CHANGEPARAMDLG_H__26C9585E_B6D6_4BF1_8A92_090050EF0DCC__INCLUDED_)
#define AFX_CHANGEPARAMDLG_H__26C9585E_B6D6_4BF1_8A92_090050EF0DCC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ChangeParamDlg.h : header file
//
#include "resource.h"
#include "apl_gui.h"
#include "CommonChangeClasses.h"
#include "apl_api.h"
#include "afxwin.h"
/////////////////////////////////////////////////////////////////////////////
// CChangeParamDlg dialog

class CChangeParamDlg : public CaplTranslateDialog
{
// Construction
public: 
	CChangeParamDlg(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CChangeParamDlg)
	enum { IDD = IDD_CHANGE_CREATE_PARAM };
	CStatic m_static14;
	CStatic	m_static13;
	CStatic	m_static12;
	CStatic	m_static10;
	CStatic	m_static11;
	CStatic	m_static9;
	CButton	m_static8;
	CStatic	m_static7;
	CStatic	m_static6;
	CStatic	m_static5;
	CButton	m_static4;
	CStatic	m_static3;
	CStatic	m_static2;
	CStatic	m_static1;
	CEdit	m_zagotov;
	CEdit	m_condition;
	CEdit	m_prior;
	CEdit	m_derValueCtrl;
	CEdit	m_ver;
	CEdit	m_name;
	CEdit	m_id;
	CEdit	m_regNum;
	CEdit	m_valueCtrl;
	CEdit	m_position;
	CEdit	m_snStart;
	CEdit	m_snEnd;
	CEdit	m_positionNumCtrl;
	CComboBox	m_sortam;
	CComboBox	m_derUnit;
	CComboBox	m_units;
	CaplButton	m_okBtn;
	CaplButton	m_cancelBtn;
	CButton	m_snEndSel;
	CaplButton	m_pdfSelBtn;
	CButton	m_dateEndSel;
	CButton	m_effNone;
	CButton	m_effSN;
	CButton	m_effDate;
	CDateTimeCtrl	m_timeStartCtrl;
	CDateTimeCtrl	m_timeEndCtrl;
	CDateTimeCtrl	m_dateStartCtrl;
	CDateTimeCtrl	m_dateEndCtrl;
	CString	m_sId;
	CString	m_sName;
	CString	m_sRegNum;
	BOOL	m_bDateEndSel;
	BOOL	m_dSNEndSel;
	int		m_effType;
	int		m_iUnits;
	int		m_iDerUnit;
	int		m_iPrior;
	int		m_iSortam;
	double	m_iValue;
	double	m_iDerValue;
	CString	m_sSNEnd;
	CString	m_sSNStart;
	CString	m_sVer;
	CString	m_sPosition;
	CString	m_sPositionNum;
	CString	m_sCondition;
	CString	m_sZagotov;
	CString m_sAssemblyInfo;
	COleDateTime	m_timeEnd;
	COleDateTime	m_timeStart;
	COleDateTime	m_dateEnd;
	COleDateTime	m_dateStart;
	//}}AFX_DATA

	CaplAPI *m_api;
	long m_mode;

	CaplInstance* m_psc;
	CPSCItemInfo* m_pscInfo;
	CaplInstance* m_change;
	
	CaplInstance* m_upLevelPdf;
	CaplInstance* m_newPdf; //была выделена

	CaplInstance* m_unitInst;
	CaplInstance* m_derUnitInst;
	CaplInstance* m_assortment;

	CaplInstance* m_parent_pdf;

	bool m_bContextsChanged;
	aplExtent m_contexts;

	CString m_sEffType;
	CString m_sStart;
	CString m_sEnd;
	
	CString m_sType;
	bool m_bReadOnly;
 
protected:	
	bool StorePscProperties(CaplInstance* item);
	bool StorePscProperties(CPSCItemInfo &item);
	bool RestorePscProperties(CaplInstance* item);
	bool RestorePscProperties(CPSCItemInfo &item);
	
	bool SetEffectivity(CString sType, CString sStart, CString sEnd= _T(""));
	bool GetEffectivity(CString &sType, CString &sStart, CString &sEnd);

	CString GetRascValue(CaplInstance *pPdf) const;
	CString GetCustomerShop(const CString &sRasc, CaplInstance *pPdf) const;
	
	void MoveCtrls();

	void ResetEdIzm();
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CChangeParamDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CChangeParamDlg)
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg void OnParamSelect();
	afx_msg void OnParamEffNo();
	afx_msg void OnParamEffDate();
	afx_msg void OnParamEffSN();
	afx_msg void OnParamSnEndSelect();
	afx_msg void OnParamDateEndSelect();
	afx_msg void OnBnClickedSelectContButton();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	CStatic m_static15;
	CStatic m_static16;
	CEdit m_pdrNameEdit;
	CString m_sPdrName;
	CString m_sPrdRasc;
	CString m_sPrdShop;
	CEdit m_pdrDscrEdit;
	CString m_sPdrDscr;
	CStatic m_static19;
	CEdit m_contextEdit;
	CaplButton m_selectContextBtn;
	CStatic m_static17;
	CStatic m_static18;
	CEdit m_shopEdit;
	CEdit m_customerEdit;
};

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

#endif // !defined(AFX_CHANGEPARAMDLG_H__26C9585E_B6D6_4BF1_8A92_090050EF0DCC__INCLUDED_)
