123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500 |
- // GetPhone.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "GetPhone.h"
- #include "MyMdi.H"
- #include "SetStyle.h"
- #include "CalendarConvert.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern BOOL CALLBACK EnumChildProc2(HWND hwnd,LPARAM lParam);
- extern void CovertDate2(CString &date);//公历转农历
- BOOL CovertDate(CString &date, CString &date2)
- {
- date2=""; if(date=="")return 0;
- if(date.GetLength ()!=10)
- {
- date="";
- return 0;
- }
- if(date.GetAt (4)!='-' || date.GetAt (7)!='-')
- {
- date="";
- return 0;
- }
- LongToGong(date);
- return 1;
- try
- {
- CCalendarConvert m_CalendarConvert;
- SYSTEMTIME src = {0};
- SYSTEMTIME dst = {0};
- COleDateTime m_timeLunar(atoi(date.Mid (0,4)),atoi(date.Mid (5,2)),atoi(date.Mid (8,2)),0,0,0);
- COleDateTime m_timeGregorian;
- m_timeLunar.GetAsSystemTime ( src );
- BOOL bEmbolism = 0;
- if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
- {
- m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
- date.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
- if(m_timeGregorian.GetYear ()==-1)date="2000-13-32";
- }
- else
- {
- date.Empty ();
- }
- bEmbolism = 1;
- if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
- {
- m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
- date2.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
- if(m_timeGregorian.GetYear ()==-1)date2="2000-13-32";
- }
- else
- {
- date2.Empty ();
- }
- }
- catch(...)
- {
- date.Empty ();date2.Empty ();
- return 0;
- }
- return 1;
- }
- ////////////////////////////////////////////////////////////IDC_STATIC1/////////////////
- GetPhone::GetPhone(CWnd* pParent /*=NULL*/)
- : CDialog(GetPhone::IDD)
- {
- //{{AFX_DATA_INIT(GetPhone)
- m_radio1 = 0;
- m_oldmode=0;
- //}}AFX_DATA_INIT
- #ifdef CHILD_VERSION
- m_radio1 = 1;
- #endif
- }
- void GetPhone::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(GetPhone)
- DDX_Control(pDX, IDC_COMBO3, m_combo3);
- DDX_Control(pDX, IDC_COMBO2, m_combo2);
- DDX_Control(pDX, IDC_COMBO1, m_combo1);
- DDX_Control(pDX, IDC_LIST2, m_List1);
- DDX_Radio(pDX, IDC_RADIO1, m_radio1);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(GetPhone, CDialog)
- //{{AFX_MSG_MAP(GetPhone)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
- ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
- ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
- ON_CBN_CLOSEUP(IDC_COMBO2, OnCloseupCombo2)
- ON_CBN_CLOSEUP(IDC_COMBO3, OnCloseupCombo3)
- ON_CBN_CLOSEUP(IDC_COMBO1, OnCloseupCombo1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // GetPhone diagnostics
- #ifdef _DEBUG
- void GetPhone::AssertValid() const
- {
- CDialog::AssertValid();
- }
- void GetPhone::Dump(CDumpContext& dc) const
- {
- CDialog::Dump(dc);
- }
- #endif //_DEBUG
- void GetPhone::OnBUTclose()
- {
- // TO DO: Add your control notification handler code here
- UpdateData();
- CString str;
- int pos;
- pos=m_combo2.GetCurSel ();
- m_combo2.GetLBText (pos, str);
- m_pArray2->Add (str);
- pos=m_combo3.GetCurSel ();
- m_combo3.GetLBText (pos, str);
- m_pArray2->Add (str);
- #ifdef CHILD_VERSION
- m_pArray2->Add ("");
- if(m_oldmode==0)
- m_pArray2->Add ("符合条件的全部客户");
- else
- {
- pos=m_combo1.GetCurSel ();
- m_combo1.GetLBText (pos, str);
- m_pArray2->Add (str+"生日客户");
- }
- #else
- if(m_radio1==0)
- m_pArray2->Add ("男女宾都发");
- else if(m_radio1==1)
- m_pArray2->Add ("只发女宾");
- else
- m_pArray2->Add ("只发男宾");
- if(m_oldmode==0)
- m_pArray2->Add ("符合条件的全部客户");
- else
- {
- pos=m_combo1.GetCurSel ();
- m_combo1.GetLBText (pos, str);
- if(m_oldmode==1)
- m_pArray2->Add (str+"生日客户");
- else if(m_oldmode==2)
- m_pArray2->Add (str+"结婚纪念客户");
- else
- m_pArray2->Add (str+"生日+结婚纪念客户");
- }
- #endif
- CDialog::OnOK ();
- }
- BOOL GetPhone::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- CRect rc2;
- GetWindowRect(rc2);
- ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
- g_WidthScale2 = (float)g_rc.Width()/(float)rc2.Width(); // new/Old
- g_HeightScale2 = (float)g_rc.Height()/(float)rc2.Height();
- EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc2,0);
- m_combo1.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_combo1.MoveWindow (rc2);
- m_combo2.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_combo2.MoveWindow (rc2);
- m_combo3.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_combo3.MoveWindow (rc2);
- m_combo1.AddString ("今天");
- m_combo1.AddString ("近两天");
- m_combo1.AddString ("近三天");
- m_combo1.AddString ("近五天");
- m_combo1.AddString ("近七天");
- m_combo1.AddString ("近十五天");
- m_combo1.AddString ("近一个月");
- m_combo1.SetCurSel (2);
- m_combo2.AddString ("不限价格");
- m_combo2.AddString ("1000以下");
- m_combo2.AddString ("1000-1999");
- m_combo2.AddString ("2000-3999");
- m_combo2.AddString ("4000-5999");
- m_combo2.AddString ("6000以上");
- m_combo2.SetCurSel (0);
- m_combo3.AddString ("不限时间");
- m_combo3.AddString ("半年以内");
- m_combo3.AddString ("1年以内");
- m_combo3.AddString ("2年以内");
- m_combo3.AddString ("3年以内");
- m_combo3.AddString ("4年以内");
- m_combo3.AddString ("5年以内");
- m_combo3.SetCurSel (0);
- GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
- SetComboHei(&m_combo1, rc2.Height ());
- SetComboHei(&m_combo2, rc2.Height ());
- SetComboHei(&m_combo3, rc2.Height ());
- #ifdef CHILD_VERSION
- m_List1.SetHeadings("家长姓名,100;宝宝姓名,100;手机,100;宝宝生日,100;套系名称,100;套系价格,100;预约时间,100" );
- #else
- m_List1.SetHeadings("男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;男宾生日,100;女宾生日,100;套系名称,100;套系价格,100;预约时间,100" );
- #endif
- m_List1.LoadColumnInfo (127);
- CArray<CStringArray, CStringArray>List1array[10];
- g_sendhead.bsql=0;
- g_sendhead.code[0]=64;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(15);
- if(g_bSendOK==0)
- {
- return true;
- }
- DataToArray(&(List1array[0]));
- // AfxMessageBox("11");
- int i = 0;
- int g_nYearposTemp=g_nYearpos;
- for( i=0; i< g_hisyeararray.GetSize (); i++)
- {
- if(i>=9)break;
- g_nYearpos=i;
- g_sendhead.bsql=0;
- g_sendhead.code[0]=64;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(15);
- if(g_bSendOK==0)
- {
- g_nYearpos=g_nYearposTemp;
- return true;
- }
- DataToArray(&(List1array[i+1]));
- }
- g_nYearpos=g_nYearposTemp;
- // AfxMessageBox("22");
- int size=0;
- for(i=0; i<10; i++)
- {
- size+=List1array[i].GetSize ();
- }
- m_List1array.SetSize(size);
- int pos=0;
- for(i=0; i<10; i++)
- {
- if(List1array[i].GetSize ()==0)continue;
- for(int a=0; a<List1array[i].GetSize (); a++)
- {
- m_List1array.ElementAt (pos).Copy (List1array[i].ElementAt (a));
- pos++;
- }
- }
- // CString check1date=Listarray2.ElementAt (a).ElementAt (10);
- // CString check2date=Listarray2.ElementAt (a).ElementAt (11);
- // CString check3date=Listarray2.ElementAt (a).ElementAt (12);
- #ifndef CHILD_VERSION
- CString date1,date2;
- for(i=0; i<m_List1array.GetSize (); i++)
- {
- if(m_List1array.ElementAt (i).ElementAt (10)=="1")
- {
- date1=m_List1array.ElementAt (i).ElementAt (5);
- // CovertDate(date1,date2);
- m_List1array.ElementAt (i).Add (date1);
- m_List1array.ElementAt (i).Add (date2);
- }
- else
- {
- m_List1array.ElementAt (i).Add ("");
- m_List1array.ElementAt (i).Add ("");
- }
- if(m_List1array.ElementAt (i).ElementAt (11)=="1")
- {
- date1=m_List1array.ElementAt (i).ElementAt (6);
- // CovertDate(date1,date2);
- m_List1array.ElementAt (i).Add (date1);
- m_List1array.ElementAt (i).Add (date2);
- }
- else
- {
- m_List1array.ElementAt (i).Add ("");
- m_List1array.ElementAt (i).Add ("");
- }
- if(m_List1array.ElementAt (i).ElementAt (12)=="1")
- {
- date1=m_List1array.ElementAt (i).ElementAt (4);
- // CovertDate(date1,date2);
- m_List1array.ElementAt (i).Add (date1);
- m_List1array.ElementAt (i).Add (date2);
- }
- else
- {
- m_List1array.ElementAt (i).Add ("");
- m_List1array.ElementAt (i).Add ("");
- }
- }
- #else
- CString date1,date2;
- for(i=0; i<m_List1array.GetSize (); i++)
- {
- if(m_List1array.ElementAt (i).ElementAt (7)=="1")
- {
- date1=m_List1array.ElementAt (i).ElementAt (3);
- // CovertDate(date1,date2);
- m_List1array.ElementAt (i).Add (date1);
- m_List1array.ElementAt (i).Add (date2);
- }
- else
- {
- m_List1array.ElementAt (i).Add ("");
- m_List1array.ElementAt (i).Add ("");
- }
- }
- #endif
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- //messagebox
- void GetPhone::FillGrid(int mode)
- {
- #ifdef CHILD_VERSION
- m_oldmode=mode;
- UpdateData();
- m_List1.DeleteAllItems2 ();
- int ii=0;
- m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
- int count=0;
- int m_days=0;
- int pos=m_combo1.GetCurSel ();
- switch(pos)
- {
- case 0:
- m_days=0;
- break;
- case 1:
- m_days=2;
- break;
- case 2:
- m_days=3;
- break;
- case 3:
- m_days=5;
- break;
- case 4:
- m_days=7;
- break;
- case 5:
- m_days=15;
- break;
- case 6:
- m_days=30;
- break;
- }
- int days2=0;
- pos=m_combo3.GetCurSel ();
- switch(pos)
- {
- case 1:
- days2=365/2;
- break;
- case 2:
- days2=365;
- break;
- case 3:
- days2=365*2;
- break;
- case 4:
- days2=365*3;
- break;
- case 5:
- days2=365*4;
- break;
- case 6:
- days2=365*5;
- break;
- }
- CString stryydate1,stryydate2;
- CTime tm=CTime::GetCurrentTime ();
- stryydate2=tm.Format ("%Y-%m-%d");
- CTimeSpan dt(days2, 0, 0, 0);
- tm-=dt;
- stryydate1=tm.Format ("%Y-%m-%d");
- int money1=0;
- int money2=0;
- pos=m_combo2.GetCurSel ();
- switch(pos)
- {
- case 1:
- money1=0;
- money2=999;
- break;
- case 2:
- money1=1000;
- money2=1999;
- break;
- case 3:
- money1=2000;
- money2=3999;
- break;
- case 4:
- money1=4000;
- money2=5999;
- break;
- case 5:
- money1=6000;
- money2=9999999;
- break;
- }
- m_pArray->RemoveAll ();
- if(mode==0)
- {
- if(days2 && money2)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2)
- if(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- else if(days2)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- else if( money2)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- //3,7
- else if(mode==1)//生日
- {
- CString strdate1,strdate2;
- CString strdate1nl,strdate2nl;
- CTime tm=CTime::GetCurrentTime ();
- strdate1nl=tm.Format ("%Y-%m-%d");
- CovertDate2(strdate1nl);
- strdate1=tm.Format ("%m-%d");
- CTimeSpan dt(m_days, 0, 0, 0);
- tm+=dt;
- strdate2=tm.Format ("%m-%d");
- strdate2nl=tm.Format ("%Y-%m-%d");
- CovertDate2(strdate2nl);
- if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
- if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (7)=="0" && m_List1array.ElementAt (ii).ElementAt (3).GetLength ()==10)
- {//男,公历
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
- continue;
- }
- if(m_List1array.ElementAt (ii).ElementAt (3).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (3).Right (5)<=strdate2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- continue;
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (7)=="1" && (m_List1array.ElementAt (ii).ElementAt (8).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (9).GetLength ()==10))
- {//男,农历
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
- continue;
- }
- if(m_List1array.ElementAt (ii).ElementAt (8).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (8).Right (5)<=strdate2nl)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- continue;
- }
- else if(m_List1array.ElementAt (ii).ElementAt (9).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (9).Right (5)<=strdate2nl)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- continue;
- }
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii=count;
- m_List1.m_LabelCount=ii;
- m_List1.SetItemCountEx (ii);
- #else
- m_oldmode=mode;
- UpdateData();
- m_List1.DeleteAllItems2 ();
- int ii=0;
- m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
- int count=0;
- int m_days=0;
- int pos=m_combo1.GetCurSel ();
- switch(pos)
- {
- case 0:
- m_days=0;
- break;
- case 1:
- m_days=2;
- break;
- case 2:
- m_days=3;
- break;
- case 3:
- m_days=5;
- break;
- case 4:
- m_days=7;
- break;
- case 5:
- m_days=15;
- break;
- case 6:
- m_days=30;
- break;
- }
- int days2=0;
- pos=m_combo3.GetCurSel ();
- switch(pos)
- {
- case 1:
- days2=365/2;
- break;
- case 2:
- days2=365;
- break;
- case 3:
- days2=365*2;
- break;
- case 4:
- days2=365*3;
- break;
- case 5:
- days2=365*4;
- break;
- case 6:
- days2=365*5;
- break;
- }
- CString stryydate1,stryydate2;
- CTime tm=CTime::GetCurrentTime ();
- stryydate2=tm.Format ("%Y-%m-%d");
- CTimeSpan dt(days2, 0, 0, 0);
- tm-=dt;
- stryydate1=tm.Format ("%Y-%m-%d");
- int money1=0;
- int money2=0;
- pos=m_combo2.GetCurSel ();
- switch(pos)
- {
- case 1:
- money1=0;
- money2=999;
- break;
- case 2:
- money1=1000;
- money2=1999;
- break;
- case 3:
- money1=2000;
- money2=3999;
- break;
- case 4:
- money1=4000;
- money2=5999;
- break;
- case 5:
- money1=6000;
- money2=9999999;
- break;
- }
- m_pArray->RemoveAll ();
- if(mode==0)
- {
- if(days2 && money2)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2)
- if(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- }
- else if(days2)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- }
- else if( money2)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- }
- //13,14,15,16,17,18
- else if(mode==1)//生日
- {
- CString strdate1,strdate2;
- CString strdate1nl,strdate2nl;
- CTime tm=CTime::GetCurrentTime ();
- strdate1nl=tm.Format ("%Y-%m-%d");
- CovertDate2(strdate1nl);
- strdate1=tm.Format ("%m-%d");
- CTimeSpan dt(m_days, 0, 0, 0);
- tm+=dt;
- strdate2=tm.Format ("%m-%d");
- strdate2nl=tm.Format ("%Y-%m-%d");
- CovertDate2(strdate2nl);
- if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
- if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (10)=="0" && m_List1array.ElementAt (ii).ElementAt (5).GetLength ()==10)
- {//男,公历
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- if(m_List1array.ElementAt (ii).ElementAt (5).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (5).Right (5)<=strdate2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- continue;
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (11)=="0" && m_List1array.ElementAt (ii).ElementAt (6).GetLength ()==10)
- {//女,公历
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- if(m_List1array.ElementAt (ii).ElementAt (6).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (6).Right (5)<=strdate2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- continue;
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (10)=="1" && (m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10))
- {//男,农历
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- if(m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10)
- {
- if(m_List1array.ElementAt (ii).ElementAt (13).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (13).Right (5)<=strdate2nl)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- continue;
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10)
- {
- if(m_List1array.ElementAt (ii).ElementAt (14).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (14).Right (5)<=strdate2nl)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- continue;
- }
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (11)=="1" && (m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10))
- {//女,农历
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- if(m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10)
- {
- if(m_List1array.ElementAt (ii).ElementAt (15).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (15).Right (5)<=strdate2nl)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- continue;
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10)
- {
- if(m_List1array.ElementAt (ii).ElementAt (16).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (16).Right (5)<=strdate2nl)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- continue;
- }
- }
- }
- }
- }
- else if(mode==2)//结婚纪念
- {
- CString strdate1,strdate2;
- CString strdate1nl,strdate2nl;
- CTime tm=CTime::GetCurrentTime ();
- strdate1nl=tm.Format ("%Y-%m-%d");
- CovertDate2(strdate1nl);
- strdate1=tm.Format ("%m-%d");
- CTimeSpan dt(m_days, 0, 0, 0);
- tm+=dt;
- strdate2=tm.Format ("%m-%d");
- strdate2nl=tm.Format ("%Y-%m-%d");
- CovertDate2(strdate2nl);
- if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
- if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (12)=="0" && m_List1array.ElementAt (ii).ElementAt (4).GetLength ()==10)
- {//结婚纪念,公历
- if(m_List1array.ElementAt (ii).ElementAt (4).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (4).Right (5)<=strdate2)
- {
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- else if(m_List1array.ElementAt (ii).ElementAt (12)=="1" && (m_List1array.ElementAt (ii).ElementAt (17).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (18).GetLength ()==10) )
- {//结婚纪念,农历
- if(m_List1array.ElementAt (ii).ElementAt (17).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (17).Right (5)<=strdate2nl)
- {
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- else if(m_List1array.ElementAt (ii).ElementAt (18).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (18).Right (5)<=strdate2nl)
- {
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- }
- }
- else if(mode==3)//生日+结婚纪念
- {
- CString strdate1,strdate2;
- CString strdate1nl,strdate2nl;
- CTime tm=CTime::GetCurrentTime ();
- strdate1nl=tm.Format ("%Y-%m-%d");
- CovertDate2(strdate1nl);
- strdate1=tm.Format ("%m-%d");
- CTimeSpan dt(m_days, 0, 0, 0);
- tm+=dt;
- strdate2=tm.Format ("%m-%d");
- strdate2nl=tm.Format ("%Y-%m-%d");
- CovertDate2(strdate2nl);
- if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
- if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(days2 && money2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- else if(days2)
- {
- if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
- continue;
- }
- else if(money2)
- {
- if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
- continue;
- }
- BOOL bAdded=0;
- if(m_List1array.ElementAt (ii).ElementAt (10)=="0" && m_List1array.ElementAt (ii).ElementAt (5).GetLength ()==10)
- {//男,公历
- if(m_List1array.ElementAt (ii).ElementAt (5).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (5).Right (5)<=strdate2)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- continue;
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (11)=="0" && m_List1array.ElementAt (ii).ElementAt (6).GetLength ()==10)
- {//女,公历
- if(m_List1array.ElementAt (ii).ElementAt (6).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (6).Right (5)<=strdate2)
- {
- if(bAdded==0)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- continue;
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (10)=="1" && (m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10))
- {//男,农历
- if(m_List1array.ElementAt (ii).ElementAt (13).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (13).Right (5)<=strdate2nl)
- {
- if(bAdded==0)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- else if(m_List1array.ElementAt (ii).ElementAt (14).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (14).Right (5)<=strdate2nl)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (11)=="1" && (m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10))
- {//女,农历
- if(m_List1array.ElementAt (ii).ElementAt (15).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (15).Right (5)<=strdate2nl)
- {
- if(bAdded==0)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_List1array.ElementAt (ii).ElementAt (16).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (16).Right (5)<=strdate2nl)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- }
- if(m_List1array.ElementAt (ii).ElementAt (12)=="0" && m_List1array.ElementAt (ii).ElementAt (4).GetLength ()==10)
- {//结婚纪念,公历
- if(m_List1array.ElementAt (ii).ElementAt (4).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (4).Right (5)<=strdate2)
- {
- if(bAdded==0)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- else if(m_List1array.ElementAt (ii).ElementAt (12)=="1" && (m_List1array.ElementAt (ii).ElementAt (17).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (18).GetLength ()==10) )
- {//结婚纪念,农历
- if(m_List1array.ElementAt (ii).ElementAt (17).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (17).Right (5)<=strdate2nl)
- {
- if(bAdded==0)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- else if(m_List1array.ElementAt (ii).ElementAt (18).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (18).Right (5)<=strdate2nl)
- {
- if(bAdded==0)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- if(m_radio1==0)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==1)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
- }
- }
- else if(m_radio1==2)
- {
- if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
- {
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
- m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii=count;
- m_List1.m_LabelCount=ii;
- m_List1.SetItemCountEx (ii);
- #endif
- }
- void GetPhone::OnButton1()
- {
- // TODO: Add your control notification handler code here
- FillGrid(0);
- }
- void GetPhone::OnButton2()
- {
- // TODO: Add your control notification handler code here
- FillGrid(1);
- }
- void GetPhone::OnButton3()
- {
- // TODO: Add your control notification handler code here
- FillGrid(2);
- }
- void GetPhone::OnButton4()
- {
- // TODO: Add your control notification handler code here
- FillGrid(3);
- }
- void GetPhone::OnRadio1()
- {
- // TODO: Add your control notification handler code here
- FillGrid(m_oldmode);
- }
- void GetPhone::OnRadio2()
- {
- // TODO: Add your control notification handler code here
- FillGrid(m_oldmode);
- }
- void GetPhone::OnRadio3()
- {
- // TODO: Add your control notification handler code here
- FillGrid(m_oldmode);
- }
- void GetPhone::OnCloseupCombo2()
- {
- // TODO: Add your control notification handler code here
- FillGrid(m_oldmode);
- }
- void GetPhone::OnCloseupCombo3()
- {
- // TODO: Add your control notification handler code here
- FillGrid(m_oldmode);
- }
- void GetPhone::OnCloseupCombo1()
- {
- // TODO: Add your control notification handler code here
- if(m_oldmode)
- FillGrid(m_oldmode);
- }
|