// choosenet.cpp : implementation file
//

#include "sms_res.h"
#include "smsafxh.h"
#include "choosenet.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CChooseNet dialog


CChooseNet::CChooseNet(CWnd* pParent /*=NULL*/)
	: CDialog(CChooseNet::IDD, pParent)
{
	//{{AFX_DATA_INIT(CChooseNet)
	m_strMCC = _T("");
	m_strMNC = _T("");
	m_strLAC = _T("");
	//}}AFX_DATA_INIT
}


void CChooseNet::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChooseNet)
	DDX_CBString(pDX, COMBO_MCC, m_strMCC);
	DDX_CBString(pDX, COMBO_MNC, m_strMNC);
	DDX_CBString(pDX, COMBO_LAC, m_strLAC);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CChooseNet, CDialog)
	//{{AFX_MSG_MAP(CChooseNet)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChooseNet message handlers

void CChooseNet::OnOK() 
{
	UpdateData(true);
	
	if(((_ttoi(m_strMCC)>=310) && (_ttoi(m_strMCC)<=316)) || (_ttoi(m_strMCC)==302)) 

	{

	}
	else
	{
		if(_tcslen(m_strMNC)==3)
		
		m_strMNC=m_strMNC.Right(2);
	}
	
	
	UpdateData(false);
	CDialog::OnOK();
}

void CChooseNet::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}
