// GetPhone.cpp : implementation file
//
#include "stdafx.h"
#include "ylgl.h"
#include "GetPhone.h"
#include "MyMdi.H"
#include "SetStyle.h"
#include "CalendarConvert.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern BOOL CALLBACK EnumChildProc2(HWND hwnd,LPARAM lParam);
extern void CovertDate2(CString &date);//����תũ��
BOOL CovertDate(CString &date, CString &date2)
{ 
	date2="";	if(date=="")return 0;
	if(date.GetLength ()!=10)
	{
		date="";
		return 0;
	}
	if(date.GetAt (4)!='-' || date.GetAt (7)!='-')
	{
		date="";
		return 0;
	}
	LongToGong(date);
	return 1;


	try
	{

		CCalendarConvert m_CalendarConvert;
		SYSTEMTIME src = {0};
		SYSTEMTIME dst = {0};
		COleDateTime m_timeLunar(atoi(date.Mid (0,4)),atoi(date.Mid (5,2)),atoi(date.Mid (8,2)),0,0,0);

		COleDateTime m_timeGregorian;
		m_timeLunar.GetAsSystemTime ( src );
		BOOL bEmbolism = 0;

		if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
		{
			m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
			date.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
			if(m_timeGregorian.GetYear ()==-1)date="2000-13-32";
		}
		else
		{
			date.Empty ();
		}
		bEmbolism = 1;
		if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
		{
			m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
			date2.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
			if(m_timeGregorian.GetYear ()==-1)date2="2000-13-32";
		}
		else
		{
			date2.Empty ();
		}
	}
	catch(...)
	{

		date.Empty ();date2.Empty ();
		return 0;
	}
	return 1;
}
////////////////////////////////////////////////////////////IDC_STATIC1/////////////////
GetPhone::GetPhone(CWnd* pParent /*=NULL*/)
: CDialog(GetPhone::IDD)
{
	//{{AFX_DATA_INIT(GetPhone)
	m_radio1 = 0;
	m_oldmode=0;
	//}}AFX_DATA_INIT
#ifdef CHILD_VERSION
	m_radio1 = 1;
#endif
}
void GetPhone::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(GetPhone)
	DDX_Control(pDX, IDC_COMBO3, m_combo3);
	DDX_Control(pDX, IDC_COMBO2, m_combo2);
	DDX_Control(pDX, IDC_COMBO1, m_combo1);
	DDX_Control(pDX, IDC_LIST2, m_List1);
	DDX_Radio(pDX, IDC_RADIO1, m_radio1);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(GetPhone, CDialog)
	//{{AFX_MSG_MAP(GetPhone)
	ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
	ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
	ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
	ON_CBN_CLOSEUP(IDC_COMBO2, OnCloseupCombo2)
	ON_CBN_CLOSEUP(IDC_COMBO3, OnCloseupCombo3)
	ON_CBN_CLOSEUP(IDC_COMBO1, OnCloseupCombo1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// GetPhone diagnostics

#ifdef _DEBUG
void GetPhone::AssertValid() const
{
	CDialog::AssertValid();
}

void GetPhone::Dump(CDumpContext& dc) const
{
	CDialog::Dump(dc);
}
#endif //_DEBUG

void GetPhone::OnBUTclose() 
{
	// TO DO: Add your control notification handler code here
	UpdateData();
	CString str;
	int pos;
	pos=m_combo2.GetCurSel ();
	m_combo2.GetLBText (pos, str);
	m_pArray2->Add (str);
	pos=m_combo3.GetCurSel ();
	m_combo3.GetLBText (pos, str);
	m_pArray2->Add (str);

#ifdef CHILD_VERSION
	m_pArray2->Add ("");
	if(m_oldmode==0)
		m_pArray2->Add ("����������ȫ���ͻ�");
	else
	{
		pos=m_combo1.GetCurSel ();
		m_combo1.GetLBText (pos, str);
		m_pArray2->Add (str+"���տͻ�");
	}
#else
	if(m_radio1==0)
		m_pArray2->Add ("��������");
	else if(m_radio1==1)
		m_pArray2->Add ("ֻ��Ů��");
	else
		m_pArray2->Add ("ֻ���б�");
	if(m_oldmode==0)
		m_pArray2->Add ("����������ȫ���ͻ�");
	else
	{
		pos=m_combo1.GetCurSel ();
		m_combo1.GetLBText (pos, str);
		if(m_oldmode==1)
			m_pArray2->Add (str+"���տͻ�");
		else if(m_oldmode==2)
			m_pArray2->Add (str+"������ͻ�");
		else
			m_pArray2->Add (str+"����+������ͻ�");
	}
#endif
	CDialog::OnOK ();
}

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

	// TODO: Add extra initialization here
	CRect rc2;
	GetWindowRect(rc2);
	::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
	g_WidthScale2 = (float)g_rc.Width()/(float)rc2.Width(); // new/Old
	g_HeightScale2 = (float)g_rc.Height()/(float)rc2.Height();
	EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc2,0);
	m_combo1.GetWindowRect (rc2);
	ScreenToClient(rc2);
	rc2.bottom +=200;
	m_combo1.MoveWindow (rc2);
	m_combo2.GetWindowRect (rc2);
	ScreenToClient(rc2);
	rc2.bottom +=200;
	m_combo2.MoveWindow (rc2);
	m_combo3.GetWindowRect (rc2);
	ScreenToClient(rc2);
	rc2.bottom +=200;
	m_combo3.MoveWindow (rc2);

	m_combo1.AddString ("����");
	m_combo1.AddString ("������");
	m_combo1.AddString ("������");
	m_combo1.AddString ("������");
	m_combo1.AddString ("������");
	m_combo1.AddString ("��ʮ����");
	m_combo1.AddString ("��һ����");
	m_combo1.SetCurSel (2);
	m_combo2.AddString ("���޼۸�");
	m_combo2.AddString ("1000����");
	m_combo2.AddString ("1000-1999");
	m_combo2.AddString ("2000-3999");
	m_combo2.AddString ("4000-5999");
	m_combo2.AddString ("6000����");
	m_combo2.SetCurSel (0);
	m_combo3.AddString ("����ʱ��");
	m_combo3.AddString ("��������");
	m_combo3.AddString ("1������");
	m_combo3.AddString ("2������");
	m_combo3.AddString ("3������");
	m_combo3.AddString ("4������");
	m_combo3.AddString ("5������");
	m_combo3.SetCurSel (0);


	GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
	SetComboHei(&m_combo1, rc2.Height ());
	SetComboHei(&m_combo2, rc2.Height ());
	SetComboHei(&m_combo3, rc2.Height ());



#ifdef CHILD_VERSION
	m_List1.SetHeadings("�ҳ�����,100;��������,100;�ֻ�,100;��������,100;��ϵ����,100;��ϵ�۸�,100;ԤԼʱ��,100" );
#else
	m_List1.SetHeadings("�б�����,100;Ů������,100;�б��绰,100;Ů���绰,100;����,100;�б�����,100;Ů������,100;��ϵ����,100;��ϵ�۸�,100;ԤԼʱ��,100" );
#endif
	m_List1.LoadColumnInfo (127);

	CArray<CStringArray, CStringArray>List1array[10];
	g_sendhead.bsql=0;
	g_sendhead.code[0]=64;
	g_sendhead.tabcount=1;
	g_pMainWnd->ProcessChatMessageRequest2(15);
	if(g_bSendOK==0)
	{
		return true;
	} 
	DataToArray(&(List1array[0])); 
	//	AfxMessageBox("11");

	int i = 0;
	int g_nYearposTemp=g_nYearpos;
	for( i=0; i<	g_hisyeararray.GetSize (); i++)
	{
		if(i>=9)break;
		g_nYearpos=i;
		g_sendhead.bsql=0;
		g_sendhead.code[0]=64;
		g_sendhead.tabcount=1;
		g_pMainWnd->ProcessChatMessageRequest2(15);
		if(g_bSendOK==0)
		{
			g_nYearpos=g_nYearposTemp;
			return true;
		}
		DataToArray(&(List1array[i+1]));
	}
	g_nYearpos=g_nYearposTemp;
	//	AfxMessageBox("22");
	int size=0;
	for(i=0; i<10; i++)
	{
		size+=List1array[i].GetSize ();
	}
	m_List1array.SetSize(size);
	int pos=0;
	for(i=0; i<10; i++)
	{
		if(List1array[i].GetSize ()==0)continue;
		for(int a=0; a<List1array[i].GetSize (); a++)
		{
			m_List1array.ElementAt (pos).Copy (List1array[i].ElementAt (a));
			pos++;
		}
	}
	//	CString check1date=Listarray2.ElementAt (a).ElementAt (10);
	//	CString check2date=Listarray2.ElementAt (a).ElementAt (11);
	//	CString check3date=Listarray2.ElementAt (a).ElementAt (12);
#ifndef CHILD_VERSION
	CString date1,date2;
	for(i=0; i<m_List1array.GetSize (); i++)
	{
		if(m_List1array.ElementAt (i).ElementAt (10)=="1")
		{
			date1=m_List1array.ElementAt (i).ElementAt (5);
			//	CovertDate(date1,date2);
			m_List1array.ElementAt (i).Add (date1);
			m_List1array.ElementAt (i).Add (date2);
		}
		else
		{
			m_List1array.ElementAt (i).Add ("");
			m_List1array.ElementAt (i).Add ("");
		}
		if(m_List1array.ElementAt (i).ElementAt (11)=="1")
		{
			date1=m_List1array.ElementAt (i).ElementAt (6);
			//	CovertDate(date1,date2);
			m_List1array.ElementAt (i).Add (date1);
			m_List1array.ElementAt (i).Add (date2);
		}
		else
		{
			m_List1array.ElementAt (i).Add ("");
			m_List1array.ElementAt (i).Add ("");
		}
		if(m_List1array.ElementAt (i).ElementAt (12)=="1")
		{
			date1=m_List1array.ElementAt (i).ElementAt (4);
			//	CovertDate(date1,date2);
			m_List1array.ElementAt (i).Add (date1);
			m_List1array.ElementAt (i).Add (date2);
		}
		else
		{
			m_List1array.ElementAt (i).Add ("");
			m_List1array.ElementAt (i).Add ("");
		}

	}
#else
	CString date1,date2;
	for(i=0; i<m_List1array.GetSize (); i++)
	{
		if(m_List1array.ElementAt (i).ElementAt (7)=="1")
		{
			date1=m_List1array.ElementAt (i).ElementAt (3);
			//	CovertDate(date1,date2);
			m_List1array.ElementAt (i).Add (date1);
			m_List1array.ElementAt (i).Add (date2);
		}
		else
		{
			m_List1array.ElementAt (i).Add ("");
			m_List1array.ElementAt (i).Add ("");
		}
	}
#endif

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
//messagebox
void GetPhone::FillGrid(int mode)
{
#ifdef CHILD_VERSION
	m_oldmode=mode;
	UpdateData();
	m_List1.DeleteAllItems2 ();
	int ii=0;
	m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
	int count=0;
	int m_days=0;
	int pos=m_combo1.GetCurSel ();
	switch(pos)
	{
	case 0:
		m_days=0;
		break;
	case 1:
		m_days=2;
		break;
	case 2:
		m_days=3;
		break;
	case 3:
		m_days=5;
		break;
	case 4:
		m_days=7;
		break;
	case 5:
		m_days=15;
		break;
	case 6:
		m_days=30;
		break;
	}
	int days2=0;
	pos=m_combo3.GetCurSel ();
	switch(pos)
	{
	case 1:
		days2=365/2;
		break;
	case 2:
		days2=365;
		break;
	case 3:
		days2=365*2;
		break;
	case 4:
		days2=365*3;
		break;
	case 5:
		days2=365*4;
		break;
	case 6:
		days2=365*5;
		break;
	}
	CString stryydate1,stryydate2;
	CTime tm=CTime::GetCurrentTime ();
	stryydate2=tm.Format ("%Y-%m-%d");
	CTimeSpan dt(days2, 0, 0, 0);
	tm-=dt;
	stryydate1=tm.Format ("%Y-%m-%d");

	int money1=0;
	int money2=0;
	pos=m_combo2.GetCurSel ();
	switch(pos)
	{
	case 1:
		money1=0;
		money2=999;
		break;
	case 2:
		money1=1000;
		money2=1999;
		break;
	case 3:
		money1=2000;
		money2=3999;
		break;
	case 4:
		money1=4000;
		money2=5999;
		break;
	case 5:
		money1=6000;
		money2=9999999;
		break;
	}

	m_pArray->RemoveAll ();

	if(mode==0)
	{
		if(days2 && money2)
		{
			for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
			{
				if(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2)
					if(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2)
					{
						m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}

					}
			}
		}
		else if(days2)
		{
			for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
			{
				if(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
				}
			}
		}
		else if( money2)
		{
			for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
			{
				if(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
				}
			}
		}
		else
		{
			for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
			{
				m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
				if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
				{
					m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
					m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
				}
			}
		}
	}
	//3,7
	else if(mode==1)//����
	{
		CString strdate1,strdate2;
		CString strdate1nl,strdate2nl;
		CTime tm=CTime::GetCurrentTime ();
		strdate1nl=tm.Format ("%Y-%m-%d");
		CovertDate2(strdate1nl);

		strdate1=tm.Format ("%m-%d");
		CTimeSpan dt(m_days, 0, 0, 0);
		tm+=dt;
		strdate2=tm.Format ("%m-%d");
		strdate2nl=tm.Format ("%Y-%m-%d");
		CovertDate2(strdate2nl);

		if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
		if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
		for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
		{
			if(m_List1array.ElementAt (ii).ElementAt (7)=="0" && m_List1array.ElementAt (ii).ElementAt (3).GetLength ()==10)
			{//������
				if(days2 && money2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
						continue;
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
						continue;
				}
				else if(days2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
						continue;
				}
				else if(money2)
				{
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
						continue;
				}
				if(m_List1array.ElementAt (ii).ElementAt (3).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (3).Right (5)<=strdate2)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
					continue;
				}
			}

			if(m_List1array.ElementAt (ii).ElementAt (7)=="1" && (m_List1array.ElementAt (ii).ElementAt (8).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (9).GetLength ()==10)) 
			{//�У�ũ��
				if(days2 && money2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
						continue;
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
						continue;
				}
				else if(days2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
						continue;
				}
				else if(money2)
				{
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
						continue;
				}
				if(m_List1array.ElementAt (ii).ElementAt (8).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (8).Right (5)<=strdate2nl)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
					continue;
				}
				else if(m_List1array.ElementAt (ii).ElementAt (9).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (9).Right (5)<=strdate2nl)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
					continue;
				}
			}
		}
	}
	m_List1.m_arLabels.SetSize(count, 1);
	ii=count;
	m_List1.m_LabelCount=ii;
	m_List1.SetItemCountEx (ii);
#else
	m_oldmode=mode;
	UpdateData();
	m_List1.DeleteAllItems2 ();
	int ii=0;
	m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
	int count=0;
	int m_days=0;
	int pos=m_combo1.GetCurSel ();
	switch(pos)
	{
	case 0:
		m_days=0;
		break;
	case 1:
		m_days=2;
		break;
	case 2:
		m_days=3;
		break;
	case 3:
		m_days=5;
		break;
	case 4:
		m_days=7;
		break;
	case 5:
		m_days=15;
		break;
	case 6:
		m_days=30;
		break;
	}
	int days2=0;
	pos=m_combo3.GetCurSel ();
	switch(pos)
	{
	case 1:
		days2=365/2;
		break;
	case 2:
		days2=365;
		break;
	case 3:
		days2=365*2;
		break;
	case 4:
		days2=365*3;
		break;
	case 5:
		days2=365*4;
		break;
	case 6:
		days2=365*5;
		break;
	}
	CString stryydate1,stryydate2;
	CTime tm=CTime::GetCurrentTime ();
	stryydate2=tm.Format ("%Y-%m-%d");
	CTimeSpan dt(days2, 0, 0, 0);
	tm-=dt;
	stryydate1=tm.Format ("%Y-%m-%d");

	int money1=0;
	int money2=0;
	pos=m_combo2.GetCurSel ();
	switch(pos)
	{
	case 1:
		money1=0;
		money2=999;
		break;
	case 2:
		money1=1000;
		money2=1999;
		break;
	case 3:
		money1=2000;
		money2=3999;
		break;
	case 4:
		money1=4000;
		money2=5999;
		break;
	case 5:
		money1=6000;
		money2=9999999;
		break;
	}

	m_pArray->RemoveAll ();

	if(mode==0)
	{
		if(days2 && money2)
		{
			for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
			{
				if(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2)
					if(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2)
					{
						m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
						if(m_radio1==0)
						{
							if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
							{
								m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
								m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
							}
							if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
							{
								m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
								m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
							}
						}
						else if(m_radio1==1)
						{
							if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
							{
								m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
								m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
							}
						}
						else if(m_radio1==2)
						{
							if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
							{
								m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
								m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
							}
						}
					}
			}
		}
		else if(days2)
		{
			for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
			{
				if(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(m_radio1==0)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==1)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==2)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
					}
				}
			}
		}
		else if( money2)
		{
			for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
			{
				if(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));

					if(m_radio1==0)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==1)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==2)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
					}
				}
			}
		}
		else
		{
			for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
			{
				m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
				if(m_radio1==0)
				{
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
					if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
					}
				}
				else if(m_radio1==1)
				{
					if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
					}
				}
				else if(m_radio1==2)
				{
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
				}
			}
		}
	}
	//13,14,15,16,17,18
	else if(mode==1)//����
	{
		CString strdate1,strdate2;
		CString strdate1nl,strdate2nl;
		CTime tm=CTime::GetCurrentTime ();
		strdate1nl=tm.Format ("%Y-%m-%d");
		CovertDate2(strdate1nl);

		strdate1=tm.Format ("%m-%d");
		CTimeSpan dt(m_days, 0, 0, 0);
		tm+=dt;
		strdate2=tm.Format ("%m-%d");
		strdate2nl=tm.Format ("%Y-%m-%d");
		CovertDate2(strdate2nl);

		if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
		if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
		for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
		{
			if(m_List1array.ElementAt (ii).ElementAt (10)=="0" && m_List1array.ElementAt (ii).ElementAt (5).GetLength ()==10)
			{//������
				if(days2 && money2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
						continue;
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
						continue;
				}
				else if(days2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
						continue;
				}
				else if(money2)
				{
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
						continue;
				}
				if(m_List1array.ElementAt (ii).ElementAt (5).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (5).Right (5)<=strdate2)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
					continue;
				}
			}
			if(m_List1array.ElementAt (ii).ElementAt (11)=="0" && m_List1array.ElementAt (ii).ElementAt (6).GetLength ()==10)
			{//������
				if(days2 && money2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
						continue;
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
						continue;
				}
				else if(days2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
						continue;
				}
				else if(money2)
				{
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
						continue;
				}
				if(m_List1array.ElementAt (ii).ElementAt (6).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (6).Right (5)<=strdate2)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
					}
					continue;
				}
			}

			if(m_List1array.ElementAt (ii).ElementAt (10)=="1" && (m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10)) 
			{//�У�ũ��
				if(days2 && money2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
						continue;
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
						continue;
				}
				else if(days2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
						continue;
				}
				else if(money2)
				{
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
						continue;
				}
				if(m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10)
				{
					if(m_List1array.ElementAt (ii).ElementAt (13).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (13).Right (5)<=strdate2nl)
			  {
				  m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
				  if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
				  {
					  m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
					  m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
				  }
				  continue;
			  }
				}
				if(m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10)
				{
					if(m_List1array.ElementAt (ii).ElementAt (14).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (14).Right (5)<=strdate2nl)
			  {
				  m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
				  if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
				  {
					  m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
					  m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
				  }
				  continue;
			  }
				}
			}

			if(m_List1array.ElementAt (ii).ElementAt (11)=="1" && (m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10)) 
			{//Ů��ũ��
				if(days2 && money2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
						continue;
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
						continue;
				}
				else if(days2)
				{
					if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
						continue;
				}
				else if(money2)
				{
					if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
						continue;
				}
				if(m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10)
				{
					if(m_List1array.ElementAt (ii).ElementAt (15).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (15).Right (5)<=strdate2nl)
			  {
				  m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
				  if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
				  {
					  m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
					  m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
				  }
				  continue;
			  }
				}

				if(m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10)
				{
					if(m_List1array.ElementAt (ii).ElementAt (16).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (16).Right (5)<=strdate2nl)
			  {
				  m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
				  if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
				  {
					  m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
					  m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
				  }
				  continue;
			  }
				}
			}
		}
	}
	else if(mode==2)//������
	{
		CString strdate1,strdate2;
		CString strdate1nl,strdate2nl;
		CTime tm=CTime::GetCurrentTime ();
		strdate1nl=tm.Format ("%Y-%m-%d");
		CovertDate2(strdate1nl);

		strdate1=tm.Format ("%m-%d");
		CTimeSpan dt(m_days, 0, 0, 0);
		tm+=dt;
		strdate2=tm.Format ("%m-%d");
		strdate2nl=tm.Format ("%Y-%m-%d");
		CovertDate2(strdate2nl);

		if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
		if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
		for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
		{
			if(m_List1array.ElementAt (ii).ElementAt (12)=="0" && m_List1array.ElementAt (ii).ElementAt (4).GetLength ()==10)
			{//���������
				if(m_List1array.ElementAt (ii).ElementAt (4).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (4).Right (5)<=strdate2)
				{
					if(days2 && money2)
			  {
				  if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
					  continue;
				  if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
					  continue;
			  }
					else if(days2)
			  {
				  if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
					  continue;
			  }
					else if(money2)
			  {
				  if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
					  continue;
			  }
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(m_radio1==0)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==1)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==2)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
					}
				}
			}
			else if(m_List1array.ElementAt (ii).ElementAt (12)=="1" && (m_List1array.ElementAt (ii).ElementAt (17).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (18).GetLength ()==10) )
			{//�����ũ��
				if(m_List1array.ElementAt (ii).ElementAt (17).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (17).Right (5)<=strdate2nl)
				{
					if(days2 && money2)
			  {
				  if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
					  continue;
				  if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
					  continue;
			  }
					else if(days2)
			  {
				  if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
					  continue;
			  }
					else if(money2)
			  {
				  if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
					  continue;
			  }
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(m_radio1==0)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==1)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==2)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
					}
				}
				else if(m_List1array.ElementAt (ii).ElementAt (18).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (18).Right (5)<=strdate2nl)
				{
					if(days2 && money2)
			  {
				  if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
					  continue;
				  if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
					  continue;
			  }
					else if(days2)
			  {
				  if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
					  continue;
			  }
					else if(money2)
			  {
				  if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
					  continue;
			  }
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(m_radio1==0)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==1)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==2)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
					}
				}
			}
		}
	}
	else if(mode==3)//����+������
	{
		CString strdate1,strdate2;
		CString strdate1nl,strdate2nl;
		CTime tm=CTime::GetCurrentTime ();
		strdate1nl=tm.Format ("%Y-%m-%d");
		CovertDate2(strdate1nl);

		strdate1=tm.Format ("%m-%d");
		CTimeSpan dt(m_days, 0, 0, 0);
		tm+=dt;
		strdate2=tm.Format ("%m-%d");
		strdate2nl=tm.Format ("%Y-%m-%d");
		CovertDate2(strdate2nl);

		if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
		if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
		for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
		{	
			if(days2 && money2)
			{
				if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
					continue;
				if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
					continue;
			}
			else if(days2)
			{
				if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
					continue;
			}
			else if(money2)
			{
				if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
					continue;
			}
			BOOL bAdded=0;
			if(m_List1array.ElementAt (ii).ElementAt (10)=="0" && m_List1array.ElementAt (ii).ElementAt (5).GetLength ()==10)
			{//������
				if(m_List1array.ElementAt (ii).ElementAt (5).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (5).Right (5)<=strdate2)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
					continue;
				}
			}

			if(m_List1array.ElementAt (ii).ElementAt (11)=="0" && m_List1array.ElementAt (ii).ElementAt (6).GetLength ()==10)
			{//������
				if(m_List1array.ElementAt (ii).ElementAt (6).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (6).Right (5)<=strdate2)
				{
					if(bAdded==0)
						m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
					if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
					}
					continue;
				}
			}

			if(m_List1array.ElementAt (ii).ElementAt (10)=="1" && (m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10)) 
			{//�У�ũ��
				if(m_List1array.ElementAt (ii).ElementAt (13).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (13).Right (5)<=strdate2nl)
				{
					if(bAdded==0)
						m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
				}
				else if(m_List1array.ElementAt (ii).ElementAt (14).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (14).Right (5)<=strdate2nl)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
					if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
					}
				}
			}

			if(m_List1array.ElementAt (ii).ElementAt (11)=="1" && (m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10)) 
			{//Ů��ũ��
				if(m_List1array.ElementAt (ii).ElementAt (15).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (15).Right (5)<=strdate2nl)
				{
					if(bAdded==0)
						m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
					if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
					}
				}
				else if(m_List1array.ElementAt (ii).ElementAt (16).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (16).Right (5)<=strdate2nl)
				{
					m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
					if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
					{
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
						m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
					}
				}
			}
			if(m_List1array.ElementAt (ii).ElementAt (12)=="0" && m_List1array.ElementAt (ii).ElementAt (4).GetLength ()==10)
			{//���������
				if(m_List1array.ElementAt (ii).ElementAt (4).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (4).Right (5)<=strdate2)
				{
					if(bAdded==0)
						m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(m_radio1==0)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==1)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==2)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
					}
				}
			}
			else if(m_List1array.ElementAt (ii).ElementAt (12)=="1" && (m_List1array.ElementAt (ii).ElementAt (17).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (18).GetLength ()==10) )
			{//�����ũ��
				if(m_List1array.ElementAt (ii).ElementAt (17).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (17).Right (5)<=strdate2nl)
				{
					if(bAdded==0)
						m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(m_radio1==0)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==1)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==2)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
					}
				}
				else if(m_List1array.ElementAt (ii).ElementAt (18).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (18).Right (5)<=strdate2nl)
				{
					if(bAdded==0)
						m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
					if(m_radio1==0)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==1)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
						}
					}
					else if(m_radio1==2)
					{
						if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
						{
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
							m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
						}
					}
				}
			}
		}
	}
	m_List1.m_arLabels.SetSize(count, 1);
	ii=count;
	m_List1.m_LabelCount=ii;
	m_List1.SetItemCountEx (ii);
#endif
}

void GetPhone::OnButton1() 
{
	// TODO: Add your control notification handler code here
	FillGrid(0);
}

void GetPhone::OnButton2() 
{
	// TODO: Add your control notification handler code here
	FillGrid(1);	
}

void GetPhone::OnButton3() 
{
	// TODO: Add your control notification handler code here
	FillGrid(2);	
}

void GetPhone::OnButton4() 
{
	// TODO: Add your control notification handler code here
	FillGrid(3);	
}

void GetPhone::OnRadio1() 
{
	// TODO: Add your control notification handler code here
	FillGrid(m_oldmode);	
}

void GetPhone::OnRadio2() 
{
	// TODO: Add your control notification handler code here
	FillGrid(m_oldmode);	
}

void GetPhone::OnRadio3() 
{
	// TODO: Add your control notification handler code here
	FillGrid(m_oldmode);	
}

void GetPhone::OnCloseupCombo2() 
{
	// TODO: Add your control notification handler code here
	FillGrid(m_oldmode);	
}

void GetPhone::OnCloseupCombo3() 
{
	// TODO: Add your control notification handler code here
	FillGrid(m_oldmode);	
}

void GetPhone::OnCloseupCombo1() 
{
	// TODO: Add your control notification handler code here
	if(m_oldmode)
		FillGrid(m_oldmode);	
}