12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502 |
- // 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 g_nYearposTemp=g_nYearpos;
- for(int 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);
- }
|