Files

158 lines
4.2 KiB
C++

#if !defined(AFX_UNITSDLG_H__195E2E02_2834_11D4_964F_00C0F02C4B69__INCLUDED_)
#define AFX_UNITSDLG_H__195E2E02_2834_11D4_964F_00C0F02C4B69__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// UnitsDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CUnitsDlg dialog
#include "gzcombo.h"
#include "gzrset.h"
#include "label.h"
class CUnitsDlg : public CDialog
{
// Construction
public:
bool m_bSubUnitSelected;
bool m_bAddIsDuplicate;
CString strClientOwnerID;
long m_lUnitID;
long m_lPMID;
void Schedule();
bool m_bIniting;
bool m_bReadOnly;
void Security();
bool m_bListByDescription;
void EnableFields(bool bEnable);
bool m_bNoRecords;
bool m_bRentalItem;
bool SaveNewRecord();
void ClearFields();
void FillFields();
void FillResellerList();
void FillClientList();
void FillModelList();
void FillSNList();
//Save fields
bool SaveField(CEdit* edControl,CString fldname,bool AllowEmpty);
bool SaveField(CgzCombo* cbControl,CString fldname);
bool SaveField(CButton* ckControl,CString fldname);
bool SaveField(CDateTimeCtrl* dtControl,CString fldname);
bool UpdateModified();
//-------------------------------
~CUnitsDlg();
CUnitsDlg(CWnd* pParent = NULL); // standard constructor
void SetReturnStrings(CString *sn,CString *client);
CSpApp* m_pApp;
//The Extra recordset is for filling combo boxes
GZRset* rs;
GZRset* cbrs;
bool m_bAddMode;
CString m_strSelectedUnit;
CString m_strSelectedClient;
CString m_strSelectedModel;
//return values
//client is for convenience only
CString * m_pstrReturnUnit;
CString * m_pstrReturnClient;
// Dialog Data
//{{AFX_DATA(CUnitsDlg)
enum { IDD = IDD_UNITS };
CLabel m_lblSubUnits;
CgzCombo m_cbSubSn;
CButton m_btnAddDuplicate;
CEdit m_edLastMeterReading;
CButton m_btnPM;
CLabel m_lblByModel;
CLabel m_lblByDesc;
CButton m_ckRental;
CEdit m_edID3;
CEdit m_edID2;
CEdit m_edID1;
CButton m_ckPM;
CStatic m_lblSNList;
CLabel m_lblResellers;
CLabel m_lblModel;
CLabel m_lblClient;
CEdit m_edWarrantyTerms;
CEdit m_edSN;
CEdit m_edReceipt;
CEdit m_edNotes;
CEdit m_edDescription;
CDateTimeCtrl m_dtPurchased;
CButton m_btnDone;
CButton m_ckBoughtHere;
CgzCombo m_cbSN;
CgzCombo m_cbResellers;
CgzCombo m_cbModels;
CgzCombo m_cbClients;
CButton m_btnAdd;
CButton m_btnDelete;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CUnitsDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CUnitsDlg)
virtual BOOL OnInitDialog();
afx_msg void OnCloseupCbsn();
afx_msg void OnCloseupCbmodels();
afx_msg void OnCloseupCbclients();
afx_msg void OnDone();
afx_msg void OnLblresellers();
afx_msg void OnLblmodel();
afx_msg void OnLblclient();
afx_msg void OnKillfocusEdwarrantyterms();
afx_msg void OnKillfocusEdsn();
afx_msg void OnKillfocusEdreceipt();
afx_msg void OnKillfocusEdnotes();
afx_msg void OnKillfocusEddescription();
afx_msg void OnDatetimechangeDtpurchased(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnCkpm();
afx_msg void OnCkboughthere();
afx_msg void OnCloseupCbresellers();
afx_msg void OnBtndelete();
afx_msg void OnBtnadd();
afx_msg void OnCkrental();
afx_msg void OnLblbydesc();
afx_msg void OnLblbymodel();
afx_msg void OnKillfocusEdid1();
afx_msg void OnKillfocusEdid2();
afx_msg void OnKillfocusEdid3();
afx_msg void OnBtnpm();
afx_msg void OnKillfocusEdlastmeterreading();
afx_msg void OnBtnaddduplicate();
afx_msg void OnCloseupCbsn2();
afx_msg void OnLblSubUnits();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
bool m_bNoPMAllowed;
public:
// Determines if PM checkbox for model can be displayed or not and sets accordingly
void DisplayModelPMCheckBox(void);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_UNITSDLG_H__195E2E02_2834_11D4_964F_00C0F02C4B69__INCLUDED_)