// Dlg_JobDetails.cpp : implementation file
//

#include "stdafx.h"
#include "SAPP1.h"
#include "Dlg_JobDetails.h"
#include "SAPP1Dlg.h"


// CDlg_JobDetails dialog

HACCEL  m_hAccelTableJobDet;

IMPLEMENT_DYNAMIC(CDlg_JobDetails, CDialog)
CDlg_JobDetails::CDlg_JobDetails(CWnd* pParent /*=NULL*/)
	: CDialog(CDlg_JobDetails::IDD, pParent)
	, str_editRefNum(_T(""))
	, str_editAssessorName(_T(""))
	, str_editComments(_T(""))
	, str_editPropertyFlatNameorNum(_T(""))
	, str_editPropertyLetter(_T(""))
	, str_editPropertyHouseNum(_T(""))
	, str_editPropertyStreet(_T(""))
	, str_editPropertyLocality(_T(""))
	, str_editPropertyDistrict(_T(""))
	, str_editPropertyTown(_T(""))
	, str_editPropertyCounty(_T(""))
	, str_editPropertyPostCode(_T(""))
	, str_editClientFlatNameorNum(_T(""))
	, str_editClientLetter(_T(""))
	, str_editClientHouseorBlockNum(_T(""))
	, str_editClientStreet(_T(""))
	, str_editClientLocality(_T(""))
	, str_editClientDistrict(_T(""))
	, str_editClientTown(_T(""))
	, str_editClientCounty(_T(""))
	, str_editClientPostCode(_T(""))
{
}

CDlg_JobDetails::~CDlg_JobDetails()
{
}

void CDlg_JobDetails::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_EDIT_PropertyFlatNumName, m_editPropertyFlatNameorNum);
	DDX_Control(pDX, IDC_EDIT_PropertyLetter, m_editPropertyLetter);
	DDX_Control(pDX, IDC_EDIT_PropertyHouseNum, m_editPropertyHouseNum);
	DDX_Control(pDX, IDC_EDIT_PropertyStreet, m_editPropertyStreet);
	DDX_Control(pDX, IDC_EDIT_PropertyLocality, m_editPropertyLocality);
	DDX_Control(pDX, IDC_EDIT_PropertyDistrict, m_editPropertyDistrict);
	DDX_Control(pDX, IDC_EDIT_PropertyTown, m_editPropertyTown);
	DDX_Control(pDX, IDC_EDIT_PropertyCounty, m_editPropertyCounty);
	DDX_Control(pDX, IDC_EDIT_PropertyPostCode, m_editPropertyPostCode);
	DDX_Control(pDX, IDC_EDIT_RefNum, m_editRefNum);
	DDX_Control(pDX, IDC_EDIT_AssessorName, m_editAssessorName);
	DDX_Control(pDX, IDC_EDIT_Comments, m_editComments);
	DDX_Control(pDX, IDC_EDIT_ClientFlatNumName, m_editClientFlatNameorNum);
	DDX_Control(pDX, IDC_EDIT_ClientLetter, m_editClientLetter);
	DDX_Control(pDX, IDC_EDIT_ClientHouseNum, m_editClientHouseorBlockNum);
	DDX_Control(pDX, IDC_EDIT_ClientStreet, m_editClientStreet);
	DDX_Control(pDX, IDC_EDIT_ClientLocality, m_editClientLocality);
	DDX_Control(pDX, IDC_EDIT_ClientDistrict, m_editClientDistrict);
	DDX_Control(pDX, IDC_EDIT_ClientTown, m_editClientTown);
	DDX_Control(pDX, IDC_EDIT_ClientCounty, m_editClientCounty);
	DDX_Control(pDX, IDC_EDIT_ClientPostCode, m_editClientPostCode);
	DDX_Text(pDX, IDC_EDIT_RefNum, str_editRefNum);
	DDX_Text(pDX, IDC_EDIT_AssessorName, str_editAssessorName);
	DDX_Text(pDX, IDC_EDIT_Comments, str_editComments);
	DDX_Text(pDX, IDC_EDIT_PropertyFlatNumName, str_editPropertyFlatNameorNum);
	DDX_Text(pDX, IDC_EDIT_PropertyLetter, str_editPropertyLetter);
	DDX_Text(pDX, IDC_EDIT_PropertyHouseNum, str_editPropertyHouseNum);
	DDX_Text(pDX, IDC_EDIT_PropertyStreet, str_editPropertyStreet);
	DDX_Text(pDX, IDC_EDIT_PropertyLocality, str_editPropertyLocality);
	DDX_Text(pDX, IDC_EDIT_PropertyDistrict, str_editPropertyDistrict);
	DDX_Text(pDX, IDC_EDIT_PropertyTown, str_editPropertyTown);
	DDX_Text(pDX, IDC_EDIT_PropertyCounty, str_editPropertyCounty);
	DDX_Text(pDX, IDC_EDIT_PropertyPostCode, str_editPropertyPostCode);
	DDX_Text(pDX, IDC_EDIT_ClientFlatNumName, str_editClientFlatNameorNum);
	DDX_Text(pDX, IDC_EDIT_ClientLetter, str_editClientLetter);
	DDX_Text(pDX, IDC_EDIT_ClientHouseNum, str_editClientHouseorBlockNum);
	DDX_Text(pDX, IDC_EDIT_ClientStreet, str_editClientStreet);
	DDX_Text(pDX, IDC_EDIT_ClientLocality, str_editClientLocality);
	DDX_Text(pDX, IDC_EDIT_ClientDistrict, str_editClientDistrict);
	DDX_Text(pDX, IDC_EDIT_ClientTown, str_editClientTown);
	DDX_Text(pDX, IDC_EDIT_ClientCounty, str_editClientCounty);
	DDX_Text(pDX, IDC_EDIT_ClientPostCode, str_editClientPostCode);
}

BEGIN_MESSAGE_MAP(CDlg_JobDetails, CDialog)
	ON_EN_CHANGE(IDC_EDIT_RefNum, OnEnChangeEditRefnum)
	ON_EN_CHANGE(IDC_EDIT_AssessorName, OnEnChangeEditAssessorname)
	ON_EN_CHANGE(IDC_EDIT_Comments, OnEnChangeEditComments)
	ON_EN_CHANGE(IDC_EDIT_PropertyFlatNumName, OnEnChangeEditPropertyflatnumname)
	ON_EN_CHANGE(IDC_EDIT_PropertyLetter, OnEnChangeEditPropertyletter)
	ON_EN_CHANGE(IDC_EDIT_PropertyHouseNum, OnEnChangeEditPropertyhousenum)
	ON_EN_CHANGE(IDC_EDIT_PropertyStreet, OnEnChangeEditPropertystreet)
	ON_EN_CHANGE(IDC_EDIT_PropertyLocality, OnEnChangeEditPropertylocality)
	ON_EN_CHANGE(IDC_EDIT_PropertyDistrict, OnEnChangeEditPropertydistrict)
	ON_EN_CHANGE(IDC_EDIT_PropertyTown, OnEnChangeEditPropertytown)
	ON_EN_CHANGE(IDC_EDIT_PropertyCounty, OnEnChangeEditPropertycounty)
	ON_EN_CHANGE(IDC_EDIT_PropertyPostCode, OnEnChangeEditPropertypostcode)
	ON_EN_CHANGE(IDC_EDIT_ClientFlatNumName, OnEnChangeEditClientflatnumname)
	ON_EN_CHANGE(IDC_EDIT_ClientLetter, OnEnChangeEditClientletter)
	ON_EN_CHANGE(IDC_EDIT_ClientHouseNum, OnEnChangeEditClienthousenum)
	ON_EN_CHANGE(IDC_EDIT_ClientStreet, OnEnChangeEditClientstreet)
	ON_EN_CHANGE(IDC_EDIT_ClientLocality, OnEnChangeEditClientlocality)
	ON_EN_CHANGE(IDC_EDIT_ClientDistrict, OnEnChangeEditClientdistrict)
	ON_EN_CHANGE(IDC_EDIT_ClientTown, OnEnChangeEditClienttown)
	ON_EN_CHANGE(IDC_EDIT_ClientCounty, OnEnChangeEditClientcounty)
	ON_EN_CHANGE(IDC_EDIT_ClientPostCode, OnEnChangeEditClientpostcode)
	ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
END_MESSAGE_MAP()

BOOL CDlg_JobDetails::OnInitDialog()
{
	CDialog::OnInitDialog();

	//------------------------------------------
	// On File >New display defaults values
	//------------------------------------------
	if(file_new_selected == true)
	{
		SetAllValuesToDefault();
	}
	
	DisplayValuesForJobDetailsDlg();

	return TRUE;
}

void CDlg_JobDetails::DisplayValuesForJobDetailsDlg()
{
	str_editRefNum.Format("%s",JobDetRefNum);
	str_editAssessorName.Format("%s",assessorName);
	str_editComments.Format("%s",JobDetComments);

	str_editPropertyFlatNameorNum.Format("%s",propertyFlatNameorNum);
	str_editPropertyLetter.Format("%s",propertyLetter);
	str_editPropertyHouseNum.Format("%s",propertyHouseNum);
	str_editPropertyStreet.Format("%s",propertyStreet);
	str_editPropertyLocality.Format("%s",propertyLocality);
	str_editPropertyDistrict.Format("%s",propertyDistrict);
	str_editPropertyTown.Format("%s",propertyTown);
	str_editPropertyCounty.Format("%s",propertyCounty);
	str_editPropertyPostCode.Format("%s",propertyPostCode);

	str_editClientFlatNameorNum.Format("%s",clientFlatNameorNum);
	str_editClientLetter.Format("%s",clientLetter);
	str_editClientHouseorBlockNum.Format("%s",clientHouseorBlockNum);
	str_editClientStreet.Format("%s",clientStreet);
	str_editClientLocality.Format("%s",clientLocality);
	str_editClientDistrict.Format("%s",clientDistrict);
	str_editClientTown.Format("%s",clientTown);
	str_editClientCounty.Format("%s",clientCounty);
	str_editClientPostCode.Format("%s",clientPostCode);

	UpdateData(FALSE);
}

void CDlg_JobDetails::ReadInputsFromJobDetailsDlg()
{
	UpdateData(TRUE);

	JobDetRefNum = str_editRefNum;
	assessorName = str_editAssessorName;
	JobDetComments = str_editComments;

	propertyFlatNameorNum = str_editPropertyFlatNameorNum;
	propertyLetter   = str_editPropertyLetter;
	propertyHouseNum = str_editPropertyHouseNum;
	propertyStreet   = str_editPropertyStreet;
	propertyLocality = str_editPropertyLocality;
	propertyDistrict = str_editPropertyDistrict;
	propertyTown     = str_editPropertyTown;
	propertyCounty   = str_editPropertyCounty;
	propertyPostCode = str_editPropertyPostCode;

	clientFlatNameorNum = str_editClientFlatNameorNum;
	clientLetter        = str_editClientLetter;
	clientHouseorBlockNum  = str_editClientHouseorBlockNum;
	clientStreet           = str_editClientStreet;
	clientLocality = str_editClientLocality;
	clientDistrict = str_editClientDistrict;
	clientTown     = str_editClientTown;
	clientCounty   = str_editClientCounty;
	clientPostCode = str_editClientPostCode;
}

void CDlg_JobDetails::OnEnChangeEditRefnum()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editAssessorName, lpszValidChars) != 0) 
	{
		str_editAssessorName = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditAssessorname()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editComments, lpszValidChars) != 0) 
	{
		str_editComments = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditComments()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*(): ;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editAssessorName, lpszValidChars) != 0) 
	{
		str_editAssessorName = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditPropertyflatnumname()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyFlatNameorNum, lpszValidChars) != 0) 
	{
		str_editPropertyFlatNameorNum = "";
		UpdateData(FALSE);
		return;
	}

	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditPropertyletter()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyLetter, lpszValidChars) != 0) 
	{
		str_editPropertyLetter = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditPropertyhousenum()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyHouseNum, lpszValidChars) != 0) 
	{
		str_editPropertyHouseNum = "";
		UpdateData(FALSE);
		return;
	}

	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditPropertystreet()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyStreet, lpszValidChars) != 0) 
	{
		str_editPropertyStreet = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditPropertylocality()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyLocality, lpszValidChars) != 0) 
	{
		str_editPropertyLocality = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditPropertydistrict()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyDistrict, lpszValidChars) != 0) 
	{
		str_editPropertyDistrict = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditPropertytown()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyTown, lpszValidChars) != 0) 
	{
		str_editPropertyTown = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditPropertycounty()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyCounty, lpszValidChars) != 0) 
	{
		str_editPropertyCounty = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}
void CDlg_JobDetails::OnEnChangeEditPropertypostcode()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editPropertyPostCode, lpszValidChars) != 0) 
	{
		str_editPropertyPostCode = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClientflatnumname()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientFlatNameorNum, lpszValidChars) != 0) 
	{
		str_editClientFlatNameorNum = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClientletter()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientLetter, lpszValidChars) != 0) 
	{
		str_editClientLetter = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClienthousenum()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientHouseorBlockNum, lpszValidChars) != 0) 
	{
		str_editClientHouseorBlockNum = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClientstreet()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("*():;'@|\?/#~.&%^{}[]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientStreet, lpszValidChars) != 0) 
	{
		str_editClientStreet = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClientlocality()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientLocality, lpszValidChars) != 0) 
	{
		str_editClientLocality = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClientdistrict()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientDistrict, lpszValidChars) != 0) 
	{
		str_editClientDistrict = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClienttown()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientTown, lpszValidChars) != 0) 
	{
		str_editClientTown = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClientcounty()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientCounty, lpszValidChars) != 0) 
	{
		str_editClientCounty = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnEnChangeEditClientpostcode()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editClientPostCode, lpszValidChars) != 0) 
	{
		str_editClientPostCode = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromJobDetailsDlg();
}

void CDlg_JobDetails::OnBnClickedButton1()
{
	AfxMessageBox("Check :)");
}

BOOL CDlg_JobDetails::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(pMsg->message==WM_KEYDOWN)
	{
		if(pMsg->wParam==VK_RETURN || pMsg->wParam==VK_ESCAPE)
			pMsg->wParam=NULL ;
	} 

	return CDialog::PreTranslateMessage(pMsg);
}