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

IMPLEMENT_DYNCREATE(YearForm, MyFormView)

YearForm::YearForm()
: MyFormView(YearForm::IDD)
{
	m_year = atoi(g_date.Mid(0, 4));
	m_month = atoi(g_date.Mid(5, 2));
	m_day = atoi(g_date.Mid(8, 2));
	m_radio1 = 0;
	m_bInit = 0;
	m_timestmap = 0;
	m_radio2 = 0;
	m_bForKF = 0;
}

YearForm::~YearForm()
{
}

void YearForm::DoDataExchange(CDataExchange* pDX)
{
	MyFormView::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_SPIN3, m_spinday);
	DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
	DDX_Control(pDX, IDC_SPIN1, m_spinyear);
	DDX_Control(pDX, IDC_LIST2, m_List1);
	DDX_Control(pDX, IDC_STATIC1, m_static1);
	DDX_Text(pDX, IDC_EDITyear, m_year);
	DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
	DDX_Text(pDX, IDC_EDITmonth, m_month);
	DDV_MinMaxUInt(pDX, m_month, 1, 12);
	DDX_Text(pDX, IDC_EDITday, m_day);
	DDV_MinMaxUInt(pDX, m_day, 1, 31);
	DDX_Radio(pDX, IDC_RADIO3, m_radio1);
	DDX_Radio(pDX, IDC_RADIO14, m_radio2);
}

BEGIN_MESSAGE_MAP(YearForm, MyFormView)

	ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
	ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
	ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
	ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
	ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
	ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
	ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
	ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
	ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
	ON_BN_CLICKED(IDC_RADIO8, OnRadio8)
	ON_BN_CLICKED(IDC_RADIO9, OnRadio9)
	ON_BN_CLICKED(IDC_RADIO10, OnRadio10)
	ON_BN_CLICKED(IDC_RADIO11, OnRadio11)
	ON_BN_CLICKED(IDC_RADIO12, OnRadio12)
	ON_BN_CLICKED(IDC_RADIO13, OnRadio13)
	ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
	ON_BN_CLICKED(IDC_BUTprint5, OnBUTprint5)
	ON_BN_CLICKED(IDC_BUTprint4, OnBUTprint4)
	ON_BN_CLICKED(IDC_RADIO14, OnRadio14)
	ON_BN_CLICKED(IDC_RADIO15, OnRadio15)

	ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList)
END_MESSAGE_MAP()


#ifdef _DEBUG
void YearForm::AssertValid() const
{
	MyFormView::AssertValid();
}

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


void YearForm::OnInitialUpdate()
{
	MyFormView::OnInitialUpdate();

#ifdef DDF_VERSION
	GetDlgItem(IDC_STATIC10)->ShowWindow(SW_SHOW);
	GetDlgItem(IDC_RADIO14)->ShowWindow(SW_SHOW);
	GetDlgItem(IDC_RADIO15)->ShowWindow(SW_SHOW);
#endif

	CMyMdi Mdi;
	Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);

	CRect rc2;
	GetWindowRect(rc2);
	::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);

	EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
	m_static1.SetFont(&g_titlefont);

	if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
		GetDlgItem(IDC_BUTprint4)->ShowWindow(SW_SHOW);

	if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
		m_List1.SetHeadings("id,0;��Ŀ����,300;���,100;��Ŀ���,100;����/֧��,100;����,100;֧����ʽ,100;����,100;�������,100;�ӵ���,100");
	else
		m_List1.SetHeadings("id,0;��Ŀ����,300;���,100;��Ŀ���,100;����/֧��,100;����,100;֧����ʽ,100;����,100;�������,100");

	m_List1.LoadColumnInfo(107);

	m_spinyear.SetRange(1900, 3000);
	m_spinmonth.SetRange(1, 12);
	m_spinday.SetRange(1, 31);

	m_bInit = 1;
	DateChange();
}

void YearForm::FillGrid()
{
	m_List1.DeleteAllItems2();
	int ii = 0;
	m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
	int count = 0;
	CString str;

	if (m_filter.IsEmpty() && m_jdd.IsEmpty())
	{
		for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
		{
			m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
		}
	}
	else if (m_jdd.IsEmpty() == 0)
	{
		float income = 0;
		int dindanshu = 0;
		for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
		{
			if (m_List1array.ElementAt(ii).ElementAt(9) == m_jdd)
			{
				m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
				income += atof(m_List1array.ElementAt(ii).ElementAt(2));
				if (m_List1array.ElementAt(ii).ElementAt(3) == "ԤԼ�տ�")
					dindanshu++;
			}
		}
		CString str;
		str.Format("%0.2f", income);
		::ConvertToPrice(str);
		SetDlgItemText(IDC_EDITmoney1, str);

		str.Format("%0.2f", income);
		::ConvertToPrice(str);
		SetDlgItemText(IDC_EDITmoney5, str);

		str.Format("%0.2f", 0);
		::ConvertToPrice(str);
		SetDlgItemText(IDC_EDITmoney2, str);

		str.Format("%0.2f", income);
		::ConvertToPrice(str);
		SetDlgItemText(IDC_EDITmoney3, str);

		str.Format("%d", dindanshu);
		SetDlgItemText(IDC_EDITmoney4, str);
	}
	else
	{
		float payout = 0;
		for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
		{
			if (m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter + ";") != -1)
			{
				m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));

				payout += atof(m_List1array.ElementAt(ii).ElementAt(2));
			}
		}
		str.Format("%0.2f", payout);
		::ConvertToPrice(str);
		SetDlgItemText(IDC_EDITmoney2, str);
		str.Format("%0.2f", -payout);
		::ConvertToPrice(str);
		SetDlgItemText(IDC_EDITmoney3, str);
	}

	m_List1.m_arLabels.SetSize(count, 1);
	ii = count;
	m_List1.m_LabelCount = ii;
	m_List1.SetItemCountEx(ii);


	str.Format("����:%d", ii);
	SetDlgItemText(IDC_STATIC2, str);

	CRect rc;
	GetDlgItem(IDC_STATIC2)->GetWindowRect(rc);
	ScreenToClient(rc);
	InvalidateRect(rc);
}

void YearForm::OnBUTclose()
{
	GetParent()->SendMessage(WM_CLOSE);
}

void YearForm::OnChangeEDITyear()
{
	DateChange();
}

void YearForm::OnChangeEDITmonth()
{

}

void YearForm::OnChangeEDITday()
{
}

void YearForm::DateChange()		// ���������������;
{
	if (m_bInit == 0)return;
	m_spinyear.EnableWindow(0);
	m_spinmonth.EnableWindow(0);
	m_spinday.EnableWindow(0);

	UpdateData();
	int i;
	int g_nYearposTemp = g_nYearpos;
	BOOL bLastYear = 0;
	BOOL bThisYear = 0;
#if JEFF_TEST_ON	// 2015��ʼ���ÿ�������;
	int g_nYearposPre = -1;
	if (m_year >= 2014 && m_year <= atoi(g_date.Left(4)) && g_hisyeararray.GetSize())
	{
		g_nYearpos = -1;
		bThisYear = 1;
		if (m_year == 2014)
		{
			g_nYearposPre = GetYearPos(m_year - 1);
		}
	}
	else if (m_year <= 2013 && g_hisyeararray.GetSize())
	{
		g_nYearpos = GetYearPos(m_year);
		if (g_nYearpos != -1)
			g_nYearposPre = GetYearPos(m_year - 1);
		bLastYear = 1;
	}
#else
	if (m_year == atoi(g_date.Left(4)) && g_hisyeararray.GetSize())
		bThisYear = 1;
	else if (m_year <= atoi(g_date.Left(4)) - 1 && g_hisyeararray.GetSize())
		bLastYear = 1;
	g_nYearpos = GetYearPos(m_year);
	int g_nYearposPre = GetYearPos(m_year - 1);
#endif

	g_sendhead.bsql = 0;
	g_sendhead.code[0] = 14;		// �����������ݱ�;
	g_sendhead.code[1] = 13;		// ֧��;
	g_sendhead.code[2] = 16;		// ����������ͼ;
	g_sendhead.code[3] = 198;		// ����2��¼���;
	g_sendhead.code[4] = 216;		// ��Ա����ͼ;
	g_sendhead.tabcount = 5;
	CString sql, strdate, strdate2;
	strdate.Format("%04d-%02d-%02d", m_year, 1, 1);
	strdate2.Format("%04d-%02d-%02d", m_year, 12, 31);

	CRect rc;
	m_static1.GetWindowRect(rc);
	ScreenToClient(rc);
	InvalidateRect(rc);
	m_static1.SetWindowText(strdate.Left(4) + "������");

	sql.Format("dat>='" + strdate + "' and dat<='" + strdate2 + "' and (sale2type is null or sale2type='');dat>='" + strdate + "' and dat<='" + strdate2 + "';date>='" + strdate + "' and date<='" + strdate2 + "';date>='" + strdate + "' and date<='" + strdate2 + "';date>='" + strdate + "' and date<='" + strdate2 + "'");
	g_pMainWnd->ProcessChatMessageRequest2(sql);
	if (g_bSendOK == 0)
	{
		g_nYearpos = g_nYearposTemp;
		m_spinyear.EnableWindow(1);
		m_spinmonth.EnableWindow(1);
		m_spinday.EnableWindow(1);
		return;
	}
	DataToArray(&List2array, &List3array, &List11array, &other2salearray, &memberarray);
	if (bLastYear)//�����ȥ��, ��ӽ���IJ���
	{
		g_nYearpos = -1;//����
		g_sendhead.bsql = 0;
		g_sendhead.code[0] = 14;		// �����������ݱ�;
		g_sendhead.code[1] = 13;		// ֧��;
		g_sendhead.code[2] = 16;		// ����������ͼ;
		g_sendhead.code[3] = 198;		// ����2��¼���;
		g_sendhead.code[4] = 216;		// ��Ա����ͼ;
		g_sendhead.tabcount = 5;
		g_pMainWnd->ProcessChatMessageRequest2(sql);
		if (g_bSendOK == 0)
		{
			g_nYearpos = g_nYearposTemp;
			m_spinyear.EnableWindow(1);
			m_spinmonth.EnableWindow(1);
			m_spinday.EnableWindow(1);
			return;
		}
		CArray<CStringArray, CStringArray>ThisYearList11array;
		CArray<CStringArray, CStringArray>ThisYearList3array;
		CArray<CStringArray, CStringArray>ThisYearList2array;
		CArray<CStringArray, CStringArray>ThisYearother2salearray;
		CArray<CStringArray, CStringArray>ThisYearmemberarray;
		DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray, &ThisYearmemberarray);

		int oldsize = List11array.GetSize();
		List11array.SetSize(oldsize + ThisYearList11array.GetSize());
		for (i = oldsize; i < oldsize + ThisYearList11array.GetSize(); i++)
		{
			List11array.ElementAt(i).Copy(ThisYearList11array.ElementAt(i - oldsize));
		}

		oldsize = List3array.GetSize();
		List3array.SetSize(oldsize + ThisYearList3array.GetSize());
		for (i = oldsize; i < oldsize + ThisYearList3array.GetSize(); i++)
		{
			List3array.ElementAt(i).Copy(ThisYearList3array.ElementAt(i - oldsize));
		}

		oldsize = List2array.GetSize();
		List2array.SetSize(oldsize + ThisYearList2array.GetSize());
		for (i = oldsize; i < oldsize + ThisYearList2array.GetSize(); i++)
		{
			List2array.ElementAt(i).Copy(ThisYearList2array.ElementAt(i - oldsize));
		}

		oldsize = other2salearray.GetSize();
		other2salearray.SetSize(oldsize + ThisYearother2salearray.GetSize());
		for (i = oldsize; i < oldsize + ThisYearother2salearray.GetSize(); i++)
		{
			other2salearray.ElementAt(i).Copy(ThisYearother2salearray.ElementAt(i - oldsize));
		}

		oldsize = memberarray.GetSize();
		memberarray.SetSize(oldsize + ThisYearmemberarray.GetSize());
		for (i = oldsize; i < oldsize + ThisYearmemberarray.GetSize(); i++)
		{
			memberarray.ElementAt(i).Copy(ThisYearmemberarray.ElementAt(i - oldsize));
		}

	}
	if (g_nYearposPre != -1)//����ǽ���, ���ȥ��IJ���
	{
		g_nYearpos = g_nYearposPre;//ȥ��
		g_sendhead.bsql = 0;
		g_sendhead.code[0] = 14;		// �����������ݱ�;
		g_sendhead.code[1] = 13;		// ֧��;
		g_sendhead.code[2] = 16;		// ����������ͼ;
		g_sendhead.code[3] = 198;		// ����2��¼���;
		g_sendhead.tabcount = 4;		
		g_pMainWnd->ProcessChatMessageRequest2(sql);
		if (g_bSendOK == 0)
		{
			g_nYearpos = g_nYearposTemp;
			m_spinyear.EnableWindow(1);
			m_spinmonth.EnableWindow(1);
			m_spinday.EnableWindow(1);
			return;
		}
		CArray<CStringArray, CStringArray>ThisYearList11array;
		CArray<CStringArray, CStringArray>ThisYearList3array;
		CArray<CStringArray, CStringArray>ThisYearList2array;
		CArray<CStringArray, CStringArray>ThisYearother2salearray;
		DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray);
		int oldsize = List11array.GetSize();
		List11array.SetSize(oldsize + ThisYearList11array.GetSize());
		for (i = oldsize; i < oldsize + ThisYearList11array.GetSize(); i++)
		{
			List11array.ElementAt(i).Copy(ThisYearList11array.ElementAt(i - oldsize));
		}

		oldsize = List3array.GetSize();
		List3array.SetSize(oldsize + ThisYearList3array.GetSize());
		for (i = oldsize; i < oldsize + ThisYearList3array.GetSize(); i++)
		{
			List3array.ElementAt(i).Copy(ThisYearList3array.ElementAt(i - oldsize));
		}

		oldsize = List2array.GetSize();
		List2array.SetSize(oldsize + ThisYearList2array.GetSize());
		for (i = oldsize; i < oldsize + ThisYearList2array.GetSize(); i++)
		{
			List2array.ElementAt(i).Copy(ThisYearList2array.ElementAt(i - oldsize));
		}

		oldsize = other2salearray.GetSize();
		other2salearray.SetSize(oldsize + ThisYearother2salearray.GetSize());
		for (i = oldsize; i < oldsize + ThisYearother2salearray.GetSize(); i++)
		{
			other2salearray.ElementAt(i).Copy(ThisYearother2salearray.ElementAt(i - oldsize));
		}
	}

	g_nYearpos = g_nYearposTemp;
	KindChange();
	m_spinyear.EnableWindow(1);
	m_spinmonth.EnableWindow(1);
	m_spinday.EnableWindow(1);
}

void YearForm::KindChange()
{
	if (m_bForKF)
	{
		KindChange2();
		return;
	}
	m_jdd = "";
	CString str;
	int pos = 0;
	int dindanshu = 0;
	float income = 0;
	float income2 = 0;
	float payout = 0;
	int count = List2array.GetSize() + List3array.GetSize() + List11array.GetSize() + other2salearray.GetSize() + memberarray.GetSize();
	m_List1array.RemoveAll();
	m_List1array.SetSize(count);
	int i = 0;

	if (m_radio1 == 3)
	{
		if (payoutdlg.GetSafeHwnd() == NULL)
		{
			payoutdlg.Create(IDD_DLGPayOutSet, this);
			CRect rc;
			m_List1.GetWindowRect(rc);
			payoutdlg.MoveWindow2(rc);
			payoutdlg.m_pParent = this;
			payoutdlg.m_mode = 1;
		}
		payoutdlg.ShowWindow(SW_SHOW);
	}
	else
	{
		m_filter.Empty();
		if (payoutdlg.GetSafeHwnd())payoutdlg.ShowWindow(SW_HIDE);
	}

	for (i = 0; i < memberarray.GetSize(); i++)
	{
		if (memberarray.ElementAt(i).ElementAt(6).IsEmpty())
			memberarray.ElementAt(i).SetAt(6, "��");
		memberarray.ElementAt(i).SetAt(0, memberarray.ElementAt(i).ElementAt(0) + ":4");
	}
	for (i = 0; i < List2array.GetSize(); i++)
	{
		if (List2array.ElementAt(i).ElementAt(10).IsEmpty())
			List2array.ElementAt(i).SetAt(10, "��");
		List2array.ElementAt(i).SetAt(0, List2array.ElementAt(i).ElementAt(0) + ":0");
	}
	for (i = 0; i < List3array.GetSize(); i++)
	{
		if (List3array.ElementAt(i).ElementAt(7).IsEmpty())
			List3array.ElementAt(i).SetAt(7, "��");
		List3array.ElementAt(i).SetAt(0, List3array.ElementAt(i).ElementAt(0) + ":1");
	}
	for (i = 0; i < List11array.GetSize(); i++)
	{
		if (List11array.ElementAt(i).ElementAt(11).IsEmpty())
			List11array.ElementAt(i).SetAt(11, "��");
		List11array.ElementAt(i).SetAt(10, List11array.ElementAt(i).ElementAt(10) + ":2");
	}
	for (i = 0; i < other2salearray.GetSize(); i++)
	{
		if (other2salearray.ElementAt(i).ElementAt(9).IsEmpty())
			other2salearray.ElementAt(i).SetAt(9, "��");
		other2salearray.ElementAt(i).SetAt(8, other2salearray.ElementAt(i).ElementAt(8) + ":3");
	}
	if (m_radio1 == 0)
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
#ifdef DDF_VERSION
			if(List11array.ElementAt (i).ElementAt (5)=="�ͷ�����")continue;
#endif
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);
			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);

			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
			income2+=atof(str);
#else
			if (List11array.ElementAt(i).ElementAt(8) != "��ֵ���ۿ�") // ��ֵ���ۿ�;
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
			if (List11array.ElementAt(i).ElementAt(5) == "ԤԼ�տ�")
				dindanshu++;
			pos++;
		}


		for (i = 0; i < List2array.GetSize(); i++)
		{
			if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
				List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");

			str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
			m_List1array.ElementAt(pos).Add(str);
			str = List2array.ElementAt(i).ElementAt(2);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
#else
			if (List2array.ElementAt(i).ElementAt(9) != "��ֵ���ۿ�")
			{
				income += atof(str);
			}
#endif
			if (List2array.ElementAt(i).ElementAt(8) != "")
			{
				income2 += atof(str);
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
			}
			else
				m_List1array.ElementAt(pos).Add("��������");
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(" ");
			pos++;
		}
		for (i = 0; i < other2salearray.GetSize(); i++)
		{
			str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(str);
			str = other2salearray.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if  0
			income+=atof(str);
			income2+=atof(str);
#else
			if (other2salearray.ElementAt(i).ElementAt(7) != "��ֵ���ۿ�")
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));

			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
			pos++;
		}

		for (i = 0; i < List3array.GetSize(); i++)
		{
			if (List3array.ElementAt(i).ElementAt(6).GetLength()>120)
				List3array.ElementAt(i).SetAt(6, List3array.ElementAt(i).ElementAt(6).Left(120) + "..");

			str = List3array.ElementAt(i).ElementAt(1) + ";" + List3array.ElementAt(i).ElementAt(4) + ";" + List3array.ElementAt(i).ElementAt(6);
			str.Replace(";;;;", ";"); str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(0));
			m_List1array.ElementAt(pos).Add(str);
			str = List3array.ElementAt(i).ElementAt(2);
			m_List1array.ElementAt(pos).Add(str);
			payout += atof(str);
#if JEFF_TEST_ON
			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(1));
#else
			m_List1array.ElementAt(pos).Add("�̶�����");
#endif
			m_List1array.ElementAt(pos).Add("֧��");
			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(3) + " " + List3array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add("�ֽ�");
			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(7));
			m_List1array.ElementAt(pos).Add(" ");
			pos++;
		}

		for (i = 0; i < memberarray.GetSize(); i++)
		{
			str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";�ͻ�:" + memberarray.ElementAt(i).ElementAt(2);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
			m_List1array.ElementAt(pos).Add(str);
			str = memberarray.ElementAt(i).ElementAt(3);
			m_List1array.ElementAt(pos).Add(str);
			income += atof(str);
			m_List1array.ElementAt(pos).Add("��Ա��ֵ");
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));

			if (memberarray.ElementAt(i).ElementAt(7) == "")
				m_List1array.ElementAt(pos).Add("�ֽ�");
			else
				m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));

			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
			m_List1array.ElementAt(pos).Add(" ");
			pos++;
		}

	}
	else if (m_radio1 == 1)//����
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
#ifdef DDF_VERSION
			if(List11array.ElementAt (i).ElementAt (5)=="�ͷ�����")continue;
#endif
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);
			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);

			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
			income2+=atof(str);
#else
			if (List11array.ElementAt(i).ElementAt(8) != "��ֵ���ۿ�") // ��ֵ���ۿ�;
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
			if (List11array.ElementAt(i).ElementAt(5) == "ԤԼ�տ�")
				dindanshu++;
			pos++;
		}

		for (i = 0; i < List2array.GetSize(); i++)
		{
			if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
				List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
			str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
			m_List1array.ElementAt(pos).Add(str);
			str = List2array.ElementAt(i).ElementAt(2);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
#else
			if (List2array.ElementAt(i).ElementAt(9) != "��ֵ���ۿ�")
			{
				income += atof(str);
			}
#endif
			if (List2array.ElementAt(i).ElementAt(8) != "")
			{
				income2 += atof(str);
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
			}
			else
				m_List1array.ElementAt(pos).Add("��������");
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(" ");
			pos++;
		}

		for (i = 0; i < other2salearray.GetSize(); i++)
		{
			str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(str);
			str = other2salearray.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if  0
			income+=atof(str);
			income2+=atof(str);
#else
			if (other2salearray.ElementAt(i).ElementAt(7) != "��ֵ���ۿ�")
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));

			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
			pos++;
		}

		for (i = 0; i < memberarray.GetSize(); i++)
		{
			str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";�ͻ�:" + memberarray.ElementAt(i).ElementAt(2);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
			m_List1array.ElementAt(pos).Add(str);
			str = memberarray.ElementAt(i).ElementAt(3);
			m_List1array.ElementAt(pos).Add(str);
			income += atof(str);
			m_List1array.ElementAt(pos).Add("��Ա��ֵ");
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));

			if (memberarray.ElementAt(i).ElementAt(7) == "")
				m_List1array.ElementAt(pos).Add("�ֽ�");
			else
				m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));

			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
			m_List1array.ElementAt(pos).Add(" ");
			pos++;
		}
	}
	else if (m_radio1 == 2)//Ӫҵ����
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
#ifdef DDF_VERSION
			if(List11array.ElementAt (i).ElementAt (5)=="�ͷ�����")continue;
#endif
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);
			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);

			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
			income2+=atof(str);
#else
			if (List11array.ElementAt(i).ElementAt(8) != "��ֵ���ۿ�") // ��ֵ���ۿ�;
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
			if (List11array.ElementAt(i).ElementAt(5) == "ԤԼ�տ�")
				dindanshu++;
			pos++;
		}

		for (i = 0; i < List2array.GetSize(); i++)
		{
			if (List2array.ElementAt(i).ElementAt(8) != "")
			{
				if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
					List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
				str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
				str.Replace(";;;", ";"); str.Replace(";;", ";");

				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
				m_List1array.ElementAt(pos).Add(str);
				str = List2array.ElementAt(i).ElementAt(2);
				m_List1array.ElementAt(pos).Add(str);
#if 0
				income+=atof(str);
				income2+=atof(str);
#else
				if (List2array.ElementAt(i).ElementAt(9) != "��ֵ���ۿ�")
				{
					income += atof(str);
				}
				income2 += atof(str);
#endif
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
				m_List1array.ElementAt(pos).Add("����");
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
				m_List1array.ElementAt(pos).Add(" ");
				pos++;
			}
		}

		for (i = 0; i < other2salearray.GetSize(); i++)
		{
			str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(str);
			str = other2salearray.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if  0
			income+=atof(str);
			income2+=atof(str);
#else
			if (other2salearray.ElementAt(i).ElementAt(7) != "��ֵ���ۿ�")
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));

			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
			pos++;
		}
	}
	else if (m_radio1 == 3)//֧��
	{
		for (i = 0; i < List3array.GetSize(); i++)
		{
			if (List3array.ElementAt(i).ElementAt(6).GetLength()>120)
				List3array.ElementAt(i).SetAt(6, List3array.ElementAt(i).ElementAt(6).Left(120) + "..");
			str = List3array.ElementAt(i).ElementAt(1) + ";" + List3array.ElementAt(i).ElementAt(4) + ";" + List3array.ElementAt(i).ElementAt(6);
			str.Replace(";;;;", ";"); str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(0));
			m_List1array.ElementAt(pos).Add(str);
			str = List3array.ElementAt(i).ElementAt(2);
			m_List1array.ElementAt(pos).Add(str);
			payout += atof(str);
#if JEFF_TEST_ON
			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(1));
#else
			m_List1array.ElementAt(pos).Add("�̶�����");
#endif
			m_List1array.ElementAt(pos).Add("֧��");
			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(3) + " " + List3array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add("�ֽ�");
			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add(List3array.ElementAt(i).ElementAt(7));
			m_List1array.ElementAt(pos).Add(" ");
			pos++;
		}
	}
	else if (m_radio1 == 4)//����
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
			if (List11array.ElementAt(i).ElementAt(5) != "ԤԼ�տ�")continue;
			dindanshu++;
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);
			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);

			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
			income2+=atof(str);
#else
			if (List11array.ElementAt(i).ElementAt(8) != "��ֵ���ۿ�") // ��ֵ���ۿ�;
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
			pos++;
		}
	}
	else if (m_radio1 == 5)//����
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
			if (List11array.ElementAt(i).ElementAt(5) != "ԤԼ����")continue;
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);
			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);

			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
			income2+=atof(str);
#else
			if (List11array.ElementAt(i).ElementAt(8) != "��ֵ���ۿ�") // ��ֵ���ۿ�;
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
			pos++;
		}
	}
	else if (m_radio1 == 6)//��Ӱ����
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
			if (List11array.ElementAt(i).ElementAt(5) != "��Ӱ����")continue;
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);
			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);


			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
			income2+=atof(str);
#else
			if (List11array.ElementAt(i).ElementAt(8) != "��ֵ���ۿ�") // ��ֵ���ۿ�;
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
			pos++;
		}
		for (i = 0; i < List2array.GetSize(); i++)
		{
			if (List2array.ElementAt(i).ElementAt(8) == "��Ӱ����")
			{
				if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
					List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
				str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
				str.Replace(";;;", ";"); str.Replace(";;", ";");

				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
				m_List1array.ElementAt(pos).Add(str);
				str = List2array.ElementAt(i).ElementAt(2);
				m_List1array.ElementAt(pos).Add(str);
#if 0
				income+=atof(str);
				income2+=atof(str);
#else
				if (List2array.ElementAt(i).ElementAt(9) != "��ֵ���ۿ�")
				{
					income += atof(str);
				}
				income2 += atof(str);
#endif
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
				m_List1array.ElementAt(pos).Add("����");
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
				m_List1array.ElementAt(pos).Add(" ");
				pos++;
			}
		}
		for (i = 0; i < other2salearray.GetSize(); i++)
		{
			if (other2salearray.ElementAt(i).ElementAt(3) == "��Ӱ����")
			{
				str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
				str.Replace(";;;", ";"); str.Replace(";;", ";");

				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
				m_List1array.ElementAt(pos).Add(str);
				str = other2salearray.ElementAt(i).ElementAt(4);
				m_List1array.ElementAt(pos).Add(str);
#if  0
				income+=atof(str);
				income2+=atof(str);
#else
				if (other2salearray.ElementAt(i).ElementAt(7) != "��ֵ���ۿ�")
				{
					income += atof(str);
				}
				income2 += atof(str);
#endif
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));

				m_List1array.ElementAt(pos).Add("����");
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
				pos++;
			}
		}

	}
	else if (m_radio1 == 7)//��ױ����
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
			if (List11array.ElementAt(i).ElementAt(5) != "��ױ����")continue;
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);
			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);


			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
			income2+=atof(str);
#else
			if (List11array.ElementAt(i).ElementAt(8) != "��ֵ���ۿ�") // ��ֵ���ۿ�;
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
			pos++;
		}
		for (i = 0; i < List2array.GetSize(); i++)
		{
			if (List2array.ElementAt(i).ElementAt(8) == "��ױ����")
			{
				if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
					List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
				str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
				str.Replace(";;;", ";"); str.Replace(";;", ";");

				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
				m_List1array.ElementAt(pos).Add(str);
				str = List2array.ElementAt(i).ElementAt(2);
				m_List1array.ElementAt(pos).Add(str);
#if 0
				income+=atof(str);
				income2+=atof(str);
#else
				if (List2array.ElementAt(i).ElementAt(9) != "��ֵ���ۿ�")
				{
					income += atof(str);
				}
				income2 += atof(str);
#endif
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
				m_List1array.ElementAt(pos).Add("����");
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
				m_List1array.ElementAt(pos).Add(" ");
				pos++;
			}
		}
		for (i = 0; i < other2salearray.GetSize(); i++)
		{
			if (other2salearray.ElementAt(i).ElementAt(3) == "��ױ����")
			{
				str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
				str.Replace(";;;", ";"); str.Replace(";;", ";");

				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
				m_List1array.ElementAt(pos).Add(str);
				str = other2salearray.ElementAt(i).ElementAt(4);
				m_List1array.ElementAt(pos).Add(str);
#if  0
				income+=atof(str);
				income2+=atof(str);
#else
				if (other2salearray.ElementAt(i).ElementAt(7) != "��ֵ���ۿ�")
				{
					income += atof(str);
				}
				income2 += atof(str);
#endif
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));

				m_List1array.ElementAt(pos).Add("����");
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
				pos++;
			}
		}

	}
	else if (m_radio1 == 8)//��ϵ��������
	{
		for (i = 0; i < memberarray.GetSize(); i++)
		{
			str = memberarray.ElementAt(i).ElementAt(1) + ";" + memberarray.ElementAt(i).ElementAt(5) + ";�ͻ�:" + memberarray.ElementAt(i).ElementAt(2);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(0));
			m_List1array.ElementAt(pos).Add(str);
			str = memberarray.ElementAt(i).ElementAt(3);
			m_List1array.ElementAt(pos).Add(str);
			income += atof(str);
			m_List1array.ElementAt(pos).Add("��Ա��ֵ");
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(4) + " " + memberarray.ElementAt(i).ElementAt(8));

			if (memberarray.ElementAt(i).ElementAt(7) == "")
				m_List1array.ElementAt(pos).Add("�ֽ�");
			else
				m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(7));

			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add(memberarray.ElementAt(i).ElementAt(6));
			m_List1array.ElementAt(pos).Add(" ");
			pos++;
		}
	}
	else if (m_radio1 == 9)//ѡƬ����
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
			if (List11array.ElementAt(i).ElementAt(5) != "ѡƬ����")continue;
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);
			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);


			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
			income2+=atof(str);
#else
			if (List11array.ElementAt(i).ElementAt(8) != "��ֵ���ۿ�") // ��ֵ���ۿ�;
			{
				income += atof(str);
			}
			income2 += atof(str);
#endif

			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));
			pos++;
		}
		for (i = 0; i < List2array.GetSize(); i++)
		{
			if (List2array.ElementAt(i).ElementAt(8) == "ѡƬ����")
			{
				if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
					List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
				str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
				str.Replace(";;;", ";"); str.Replace(";;", ";");

				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
				m_List1array.ElementAt(pos).Add(str);
				str = List2array.ElementAt(i).ElementAt(2);
				m_List1array.ElementAt(pos).Add(str);
#if 0
				income+=atof(str);
				income2+=atof(str);
#else
				if (List2array.ElementAt(i).ElementAt(9) != "��ֵ���ۿ�")
				{
					income += atof(str);
				}
				income2 += atof(str);
#endif
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(8));
				m_List1array.ElementAt(pos).Add("����");
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
				m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
				m_List1array.ElementAt(pos).Add(" ");
				pos++;
			}
		}
		for (i = 0; i < other2salearray.GetSize(); i++)
		{
			if (other2salearray.ElementAt(i).ElementAt(3) == "ѡƬ����")
			{
				str = other2salearray.ElementAt(i).ElementAt(0) + ";" + other2salearray.ElementAt(i).ElementAt(1) + ";" + other2salearray.ElementAt(i).ElementAt(2);
				str.Replace(";;;", ";"); str.Replace(";;", ";");

				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(8));
				m_List1array.ElementAt(pos).Add(str);
				str = other2salearray.ElementAt(i).ElementAt(4);
				m_List1array.ElementAt(pos).Add(str);
#if  0
				income+=atof(str);
				income2+=atof(str);
#else
				if (other2salearray.ElementAt(i).ElementAt(7) != "��ֵ���ۿ�")
				{
					income += atof(str);
				}
				income2 += atof(str);
#endif
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(3));

				m_List1array.ElementAt(pos).Add("����");
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(5) + " " + other2salearray.ElementAt(i).ElementAt(10));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(7));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(6));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(9));
				m_List1array.ElementAt(pos).Add(other2salearray.ElementAt(i).ElementAt(11));
				pos++;
			}
		}
	}
	else if (m_radio1 == 10)//��������
	{
		for (i = 0; i < List2array.GetSize(); i++)
		{
			if (List2array.ElementAt(i).ElementAt(8) != "")continue;
			if (List2array.ElementAt(i).ElementAt(7).GetLength()>120)
				List2array.ElementAt(i).SetAt(7, List2array.ElementAt(i).ElementAt(7).Left(120) + "..");
			str = List2array.ElementAt(i).ElementAt(1) + ";" + List2array.ElementAt(i).ElementAt(4) + ";" + List2array.ElementAt(i).ElementAt(6) + ";" + List2array.ElementAt(i).ElementAt(7);
			str.Replace(";;;", ";"); str.Replace(";;", ";");

			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(0));
			m_List1array.ElementAt(pos).Add(str);
			str = List2array.ElementAt(i).ElementAt(2);
			m_List1array.ElementAt(pos).Add(str);
#if 0
			income+=atof(str);
#else
			if (List2array.ElementAt(i).ElementAt(9) != "��ֵ���ۿ�")
			{
				income += atof(str);
			}
#endif
			m_List1array.ElementAt(pos).Add("��������");
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(3) + " " + List2array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add(List2array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(" ");
			pos++;
		}
	}


	m_List1array.SetSize(pos);
	str.Format("%0.2f", income);
	::ConvertToPrice(str);
	SetDlgItemText(IDC_EDITmoney1, str);

	str.Format("%0.2f", income2);
	::ConvertToPrice(str);
	SetDlgItemText(IDC_EDITmoney5, str);

	str.Format("%0.2f", payout);
	::ConvertToPrice(str);
	SetDlgItemText(IDC_EDITmoney2, str);

	str.Format("%0.2f", income - payout);
	::ConvertToPrice(str);
	SetDlgItemText(IDC_EDITmoney3, str);

	str.Format("%d", dindanshu);
	SetDlgItemText(IDC_EDITmoney4, str);
	FillGrid();
}

void YearForm::OnRadio3()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio4()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio5()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio6()
{
	UpdateData();
	m_filter.Empty();
	KindChange();
}

void YearForm::OnRadio7()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio8()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio9()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio10()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio11()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio12()
{
	UpdateData();
	KindChange();
}

void YearForm::OnRadio13()
{
	UpdateData();
	KindChange();
}

void YearForm::OnBUTprint()
{
	if (m_List1.GetItemCount() == 0)
	{
		AfxMessageBox("������!", MB_ICONINFORMATION);
		return;
	}
	CArray<CStringArray, CStringArray>Listarray;

	CString str, temp;
	m_static1.GetWindowText(str);
	CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + str;


	int count = m_List1.GetItemCount() / 45;
	if (m_List1.GetItemCount() % 45)count++;
	Listarray.SetSize(m_List1.GetItemCount() + count, 1);

	int pos = 0;
	float otherpaytype1 = 0;
	float otherpaytype2 = 0;
	float otherpaytype3 = 0;
	int addpos = 1;
	for (int i = 0; i < m_List1.GetItemCount(); i++)
	{
		if (i % 45 == 0)
		{
			Listarray.ElementAt(pos).Add("��Ŀ����");
			Listarray.ElementAt(pos).Add("���");
			Listarray.ElementAt(pos).Add("��Ŀ���");
			Listarray.ElementAt(pos).Add("����/֧��");
			pos++;
		}
		for (int j = 0; j < 3; j++)
			Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, j + addpos));

		Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 3 + addpos) + "/" + m_List1.GetItemText(i, 5 + addpos));

		if (m_List1.GetItemText(i, 5 + addpos) == "POS��ˢ��")
			otherpaytype1 += atof(m_List1.GetItemText(i, 1 + addpos));
		else if (m_List1.GetItemText(i, 5 + addpos) == "��ֵ���ۿ�")
			otherpaytype2 += atof(m_List1.GetItemText(i, 1 + addpos));
		else if (m_List1.GetItemText(i, 5 + addpos) == "���ֶһ�")
			otherpaytype3 += atof(m_List1.GetItemText(i, 1 + addpos));


		pos++;
	}
	Listarray.SetSize(pos, 1);

	str = "������:";
	GetDlgItemText(IDC_EDITmoney1, temp); str += temp;
	str += "  Ӫҵ����:";
	GetDlgItemText(IDC_EDITmoney5, temp); str += temp;
	str += "  ��֧��:";
	GetDlgItemText(IDC_EDITmoney2, temp); str += temp;
	str += "  ������:";
	GetDlgItemText(IDC_EDITmoney3, temp); str += temp;
	str += "  ������:";
	GetDlgItemText(IDC_EDITmoney4, temp); str += temp;

	str += "***";
	temp.Format("POS��ˢ��:%d", (int)otherpaytype1);
	str += temp;
	temp.Format(" ��ֵ���ۿ�:%d", (int)otherpaytype2);
	str += temp;
	temp.Format(" ���ֶһ�:%d", (int)otherpaytype3);
	str += temp;

	CString ss;
	GetDlgItemText(IDC_EDITmoney3, ss);
	//temp.Format (" �ֽ�:%d", (int) (atof(ss)-(otherpaytype1+otherpaytype2+otherpaytype3)) );
	temp.Format(" ��̨�ֽ�:%d", (int)(atof(ss) - (otherpaytype1 + otherpaytype3)));
	str += temp;
	g_pMainWnd->PrintDailyForm(&Listarray, title, str);
}

void YearForm::TypeChange(CString str)
{
	m_filter = str;
	FillGrid();
}

void YearForm::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
{
	NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);

	*pResult = 0;

	if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
	{
		*pResult = CDRF_NOTIFYITEMDRAW;
	}
	else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
	{
		if (m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8).Find("�����") == -1)
			pLVCD->clrText = RGB(220, 0, 0);
		else
			pLVCD->clrText = RGB(20, 133, 20);

		if (pLVCD->nmcd.dwItemSpec % 2)
			pLVCD->clrTextBk = g_gridcol1;
		else
			pLVCD->clrTextBk = g_gridcol2;

		*pResult = CDRF_DODEFAULT;
	}
}

void YearForm::OnBUTprint5()
{
	CString str;
	m_static1.GetWindowText(str);
	ListToXLS(&m_List1, "c:\\" + str + ".xls", 1);
}

void YearForm::OnBUTprint4()
{
	if (atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
	{
		SelExpendType dlg;
		dlg.m_mode = 3;
		if (dlg.DoModal() == IDOK)
		{
			m_jdd = dlg.m_sel;
			FillGrid();
		}
	}
}

void YearForm::OnRadio14()
{
	UpdateData();
	if (m_radio2 == 0)m_bForKF = 0;
	else
	{
		m_bForKF = 1;
	}
	KindChange();
}

void YearForm::OnRadio15()
{
	OnRadio14();
}

void YearForm::KindChange2()
{
	m_jdd = "";
	CString str;
	int pos = 0;
	int dindanshu = 0;
	float income = 0;
	float income2 = 0;
	float payout = 0;
	int count = List2array.GetSize() + List3array.GetSize() + List11array.GetSize() + other2salearray.GetSize() + memberarray.GetSize();
	m_List1array.RemoveAll();
	m_List1array.SetSize(count);
	int i = 0;

	{
		m_filter.Empty();
		if (payoutdlg.GetSafeHwnd())payoutdlg.ShowWindow(SW_HIDE);
	}

	for (i = 0; i < memberarray.GetSize(); i++)
	{
		if (memberarray.ElementAt(i).ElementAt(6).IsEmpty())
			memberarray.ElementAt(i).SetAt(6, "��");
		memberarray.ElementAt(i).SetAt(0, memberarray.ElementAt(i).ElementAt(0) + ":4");
	}
	for (i = 0; i < List2array.GetSize(); i++)
	{
		if (List2array.ElementAt(i).ElementAt(10).IsEmpty())
			List2array.ElementAt(i).SetAt(10, "��");
		List2array.ElementAt(i).SetAt(0, List2array.ElementAt(i).ElementAt(0) + ":0");
	}
	for (i = 0; i < List3array.GetSize(); i++)
	{
		if (List3array.ElementAt(i).ElementAt(7).IsEmpty())
			List3array.ElementAt(i).SetAt(7, "��");
		List3array.ElementAt(i).SetAt(0, List3array.ElementAt(i).ElementAt(0) + ":1");
	}
	for (i = 0; i < List11array.GetSize(); i++)
	{
		if (List11array.ElementAt(i).ElementAt(11).IsEmpty())
			List11array.ElementAt(i).SetAt(11, "��");
		List11array.ElementAt(i).SetAt(10, List11array.ElementAt(i).ElementAt(10) + ":2");
	}
	for (i = 0; i < other2salearray.GetSize(); i++)
	{
		if (other2salearray.ElementAt(i).ElementAt(9).IsEmpty())
			other2salearray.ElementAt(i).SetAt(9, "��");
		other2salearray.ElementAt(i).SetAt(8, other2salearray.ElementAt(i).ElementAt(8) + ":3");
	}

	//if(m_radio1==2)//Ӫҵ����
	{
		for (i = 0; i < List11array.GetSize(); i++)
		{
			if (List11array.ElementAt(i).ElementAt(5) != "�ͷ�����")continue;
			str = List11array.ElementAt(i).ElementAt(0);
			str += ";" + List11array.ElementAt(i).ElementAt(3);
			if (!List11array.ElementAt(i).ElementAt(1).IsEmpty())
			{
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(1);
				if (!List11array.ElementAt(i).ElementAt(2).IsEmpty())
					str += "," + List11array.ElementAt(i).ElementAt(2);

			}
			else
				str += ";�ͻ�:" + List11array.ElementAt(i).ElementAt(2);

			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(10));
			m_List1array.ElementAt(pos).Add(str);
			str = List11array.ElementAt(i).ElementAt(4);
			m_List1array.ElementAt(pos).Add(str);
			income += atof(str);
			income2 += atof(str);
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(5));
			m_List1array.ElementAt(pos).Add("����");
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(7) + " " + List11array.ElementAt(i).ElementAt(13));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(8));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(9));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(11));
			m_List1array.ElementAt(pos).Add(List11array.ElementAt(i).ElementAt(12));

			pos++;
		}
	}

	m_List1array.SetSize(pos);
	str.Format("%0.2f", income);
	::ConvertToPrice(str);
	SetDlgItemText(IDC_EDITmoney1, str);

	str.Format("%0.2f", income);
	::ConvertToPrice(str);
	SetDlgItemText(IDC_EDITmoney5, str);

	str.Format("%0.2f", 0);
	::ConvertToPrice(str);
	SetDlgItemText(IDC_EDITmoney2, str);

	str.Format("%0.2f", income);
	::ConvertToPrice(str);
	SetDlgItemText(IDC_EDITmoney3, str);

	str.Format("%d", 0);
	SetDlgItemText(IDC_EDITmoney4, str);
	FillGrid();
}