GetPhone.cpp 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502
  1. // GetPhone.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "GetPhone.h"
  6. #include "MyMdi.H"
  7. #include "SetStyle.h"
  8. #include "CalendarConvert.h"
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14. extern BOOL CALLBACK EnumChildProc2(HWND hwnd,LPARAM lParam);
  15. extern void CovertDate2(CString &date);//公历转农历
  16. BOOL CovertDate(CString &date, CString &date2)
  17. {
  18. date2=""; if(date=="")return 0;
  19. if(date.GetLength ()!=10)
  20. {
  21. date="";
  22. return 0;
  23. }
  24. if(date.GetAt (4)!='-' || date.GetAt (7)!='-')
  25. {
  26. date="";
  27. return 0;
  28. }
  29. LongToGong(date);
  30. return 1;
  31. try
  32. {
  33. CCalendarConvert m_CalendarConvert;
  34. SYSTEMTIME src = {0};
  35. SYSTEMTIME dst = {0};
  36. COleDateTime m_timeLunar(atoi(date.Mid (0,4)),atoi(date.Mid (5,2)),atoi(date.Mid (8,2)),0,0,0);
  37. COleDateTime m_timeGregorian;
  38. m_timeLunar.GetAsSystemTime ( src );
  39. BOOL bEmbolism = 0;
  40. if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
  41. {
  42. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
  43. date.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
  44. if(m_timeGregorian.GetYear ()==-1)date="2000-13-32";
  45. }
  46. else
  47. {
  48. date.Empty ();
  49. }
  50. bEmbolism = 1;
  51. if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
  52. {
  53. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
  54. date2.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
  55. if(m_timeGregorian.GetYear ()==-1)date2="2000-13-32";
  56. }
  57. else
  58. {
  59. date2.Empty ();
  60. }
  61. }
  62. catch(...)
  63. {
  64. date.Empty ();date2.Empty ();
  65. return 0;
  66. }
  67. return 1;
  68. }
  69. ////////////////////////////////////////////////////////////IDC_STATIC1/////////////////
  70. GetPhone::GetPhone(CWnd* pParent /*=NULL*/)
  71. : CDialog(GetPhone::IDD)
  72. {
  73. //{{AFX_DATA_INIT(GetPhone)
  74. m_radio1 = 0;
  75. m_oldmode=0;
  76. //}}AFX_DATA_INIT
  77. #ifdef CHILD_VERSION
  78. m_radio1 = 1;
  79. #endif
  80. }
  81. void GetPhone::DoDataExchange(CDataExchange* pDX)
  82. {
  83. CDialog::DoDataExchange(pDX);
  84. //{{AFX_DATA_MAP(GetPhone)
  85. DDX_Control(pDX, IDC_COMBO3, m_combo3);
  86. DDX_Control(pDX, IDC_COMBO2, m_combo2);
  87. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  88. DDX_Control(pDX, IDC_LIST2, m_List1);
  89. DDX_Radio(pDX, IDC_RADIO1, m_radio1);
  90. //}}AFX_DATA_MAP
  91. }
  92. BEGIN_MESSAGE_MAP(GetPhone, CDialog)
  93. //{{AFX_MSG_MAP(GetPhone)
  94. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  95. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  96. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  97. ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
  98. ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
  99. ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
  100. ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
  101. ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
  102. ON_CBN_CLOSEUP(IDC_COMBO2, OnCloseupCombo2)
  103. ON_CBN_CLOSEUP(IDC_COMBO3, OnCloseupCombo3)
  104. ON_CBN_CLOSEUP(IDC_COMBO1, OnCloseupCombo1)
  105. //}}AFX_MSG_MAP
  106. END_MESSAGE_MAP()
  107. /////////////////////////////////////////////////////////////////////////////
  108. // GetPhone diagnostics
  109. #ifdef _DEBUG
  110. void GetPhone::AssertValid() const
  111. {
  112. CDialog::AssertValid();
  113. }
  114. void GetPhone::Dump(CDumpContext& dc) const
  115. {
  116. CDialog::Dump(dc);
  117. }
  118. #endif //_DEBUG
  119. void GetPhone::OnBUTclose()
  120. {
  121. // TO DO: Add your control notification handler code here
  122. UpdateData();
  123. CString str;
  124. int pos;
  125. pos=m_combo2.GetCurSel ();
  126. m_combo2.GetLBText (pos, str);
  127. m_pArray2->Add (str);
  128. pos=m_combo3.GetCurSel ();
  129. m_combo3.GetLBText (pos, str);
  130. m_pArray2->Add (str);
  131. #ifdef CHILD_VERSION
  132. m_pArray2->Add ("");
  133. if(m_oldmode==0)
  134. m_pArray2->Add ("符合条件的全部客户");
  135. else
  136. {
  137. pos=m_combo1.GetCurSel ();
  138. m_combo1.GetLBText (pos, str);
  139. m_pArray2->Add (str+"生日客户");
  140. }
  141. #else
  142. if(m_radio1==0)
  143. m_pArray2->Add ("男女宾都发");
  144. else if(m_radio1==1)
  145. m_pArray2->Add ("只发女宾");
  146. else
  147. m_pArray2->Add ("只发男宾");
  148. if(m_oldmode==0)
  149. m_pArray2->Add ("符合条件的全部客户");
  150. else
  151. {
  152. pos=m_combo1.GetCurSel ();
  153. m_combo1.GetLBText (pos, str);
  154. if(m_oldmode==1)
  155. m_pArray2->Add (str+"生日客户");
  156. else if(m_oldmode==2)
  157. m_pArray2->Add (str+"结婚纪念客户");
  158. else
  159. m_pArray2->Add (str+"生日+结婚纪念客户");
  160. }
  161. #endif
  162. CDialog::OnOK ();
  163. }
  164. BOOL GetPhone::OnInitDialog()
  165. {
  166. CDialog::OnInitDialog();
  167. // TODO: Add extra initialization here
  168. CRect rc2;
  169. GetWindowRect(rc2);
  170. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  171. g_WidthScale2 = (float)g_rc.Width()/(float)rc2.Width(); // new/Old
  172. g_HeightScale2 = (float)g_rc.Height()/(float)rc2.Height();
  173. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc2,0);
  174. m_combo1.GetWindowRect (rc2);
  175. ScreenToClient(rc2);
  176. rc2.bottom +=200;
  177. m_combo1.MoveWindow (rc2);
  178. m_combo2.GetWindowRect (rc2);
  179. ScreenToClient(rc2);
  180. rc2.bottom +=200;
  181. m_combo2.MoveWindow (rc2);
  182. m_combo3.GetWindowRect (rc2);
  183. ScreenToClient(rc2);
  184. rc2.bottom +=200;
  185. m_combo3.MoveWindow (rc2);
  186. m_combo1.AddString ("今天");
  187. m_combo1.AddString ("近两天");
  188. m_combo1.AddString ("近三天");
  189. m_combo1.AddString ("近五天");
  190. m_combo1.AddString ("近七天");
  191. m_combo1.AddString ("近十五天");
  192. m_combo1.AddString ("近一个月");
  193. m_combo1.SetCurSel (2);
  194. m_combo2.AddString ("不限价格");
  195. m_combo2.AddString ("1000以下");
  196. m_combo2.AddString ("1000-1999");
  197. m_combo2.AddString ("2000-3999");
  198. m_combo2.AddString ("4000-5999");
  199. m_combo2.AddString ("6000以上");
  200. m_combo2.SetCurSel (0);
  201. m_combo3.AddString ("不限时间");
  202. m_combo3.AddString ("半年以内");
  203. m_combo3.AddString ("1年以内");
  204. m_combo3.AddString ("2年以内");
  205. m_combo3.AddString ("3年以内");
  206. m_combo3.AddString ("4年以内");
  207. m_combo3.AddString ("5年以内");
  208. m_combo3.SetCurSel (0);
  209. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  210. SetComboHei(&m_combo1, rc2.Height ());
  211. SetComboHei(&m_combo2, rc2.Height ());
  212. SetComboHei(&m_combo3, rc2.Height ());
  213. #ifdef CHILD_VERSION
  214. m_List1.SetHeadings("家长姓名,100;宝宝姓名,100;手机,100;宝宝生日,100;套系名称,100;套系价格,100;预约时间,100" );
  215. #else
  216. m_List1.SetHeadings("男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;男宾生日,100;女宾生日,100;套系名称,100;套系价格,100;预约时间,100" );
  217. #endif
  218. m_List1.LoadColumnInfo (127);
  219. CArray<CStringArray, CStringArray>List1array[10];
  220. g_sendhead.bsql=0;
  221. g_sendhead.code[0]=64;
  222. g_sendhead.tabcount=1;
  223. g_pMainWnd->ProcessChatMessageRequest2(15);
  224. if(g_bSendOK==0)
  225. {
  226. return true;
  227. }
  228. DataToArray(&(List1array[0]));
  229. // AfxMessageBox("11");
  230. int i = 0;
  231. int g_nYearposTemp=g_nYearpos;
  232. for( i=0; i< g_hisyeararray.GetSize (); i++)
  233. {
  234. if(i>=9)break;
  235. g_nYearpos=i;
  236. g_sendhead.bsql=0;
  237. g_sendhead.code[0]=64;
  238. g_sendhead.tabcount=1;
  239. g_pMainWnd->ProcessChatMessageRequest2(15);
  240. if(g_bSendOK==0)
  241. {
  242. g_nYearpos=g_nYearposTemp;
  243. return true;
  244. }
  245. DataToArray(&(List1array[i+1]));
  246. }
  247. g_nYearpos=g_nYearposTemp;
  248. // AfxMessageBox("22");
  249. int size=0;
  250. for(i=0; i<10; i++)
  251. {
  252. size+=List1array[i].GetSize ();
  253. }
  254. m_List1array.SetSize(size);
  255. int pos=0;
  256. for(i=0; i<10; i++)
  257. {
  258. if(List1array[i].GetSize ()==0)continue;
  259. for(int a=0; a<List1array[i].GetSize (); a++)
  260. {
  261. m_List1array.ElementAt (pos).Copy (List1array[i].ElementAt (a));
  262. pos++;
  263. }
  264. }
  265. // CString check1date=Listarray2.ElementAt (a).ElementAt (10);
  266. // CString check2date=Listarray2.ElementAt (a).ElementAt (11);
  267. // CString check3date=Listarray2.ElementAt (a).ElementAt (12);
  268. #ifndef CHILD_VERSION
  269. CString date1,date2;
  270. for(i=0; i<m_List1array.GetSize (); i++)
  271. {
  272. if(m_List1array.ElementAt (i).ElementAt (10)=="1")
  273. {
  274. date1=m_List1array.ElementAt (i).ElementAt (5);
  275. // CovertDate(date1,date2);
  276. m_List1array.ElementAt (i).Add (date1);
  277. m_List1array.ElementAt (i).Add (date2);
  278. }
  279. else
  280. {
  281. m_List1array.ElementAt (i).Add ("");
  282. m_List1array.ElementAt (i).Add ("");
  283. }
  284. if(m_List1array.ElementAt (i).ElementAt (11)=="1")
  285. {
  286. date1=m_List1array.ElementAt (i).ElementAt (6);
  287. // CovertDate(date1,date2);
  288. m_List1array.ElementAt (i).Add (date1);
  289. m_List1array.ElementAt (i).Add (date2);
  290. }
  291. else
  292. {
  293. m_List1array.ElementAt (i).Add ("");
  294. m_List1array.ElementAt (i).Add ("");
  295. }
  296. if(m_List1array.ElementAt (i).ElementAt (12)=="1")
  297. {
  298. date1=m_List1array.ElementAt (i).ElementAt (4);
  299. // CovertDate(date1,date2);
  300. m_List1array.ElementAt (i).Add (date1);
  301. m_List1array.ElementAt (i).Add (date2);
  302. }
  303. else
  304. {
  305. m_List1array.ElementAt (i).Add ("");
  306. m_List1array.ElementAt (i).Add ("");
  307. }
  308. }
  309. #else
  310. CString date1,date2;
  311. for(i=0; i<m_List1array.GetSize (); i++)
  312. {
  313. if(m_List1array.ElementAt (i).ElementAt (7)=="1")
  314. {
  315. date1=m_List1array.ElementAt (i).ElementAt (3);
  316. // CovertDate(date1,date2);
  317. m_List1array.ElementAt (i).Add (date1);
  318. m_List1array.ElementAt (i).Add (date2);
  319. }
  320. else
  321. {
  322. m_List1array.ElementAt (i).Add ("");
  323. m_List1array.ElementAt (i).Add ("");
  324. }
  325. }
  326. #endif
  327. return TRUE; // return TRUE unless you set the focus to a control
  328. // EXCEPTION: OCX Property Pages should return FALSE
  329. }
  330. //messagebox
  331. void GetPhone::FillGrid(int mode)
  332. {
  333. #ifdef CHILD_VERSION
  334. m_oldmode=mode;
  335. UpdateData();
  336. m_List1.DeleteAllItems2 ();
  337. int ii=0;
  338. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  339. int count=0;
  340. int m_days=0;
  341. int pos=m_combo1.GetCurSel ();
  342. switch(pos)
  343. {
  344. case 0:
  345. m_days=0;
  346. break;
  347. case 1:
  348. m_days=2;
  349. break;
  350. case 2:
  351. m_days=3;
  352. break;
  353. case 3:
  354. m_days=5;
  355. break;
  356. case 4:
  357. m_days=7;
  358. break;
  359. case 5:
  360. m_days=15;
  361. break;
  362. case 6:
  363. m_days=30;
  364. break;
  365. }
  366. int days2=0;
  367. pos=m_combo3.GetCurSel ();
  368. switch(pos)
  369. {
  370. case 1:
  371. days2=365/2;
  372. break;
  373. case 2:
  374. days2=365;
  375. break;
  376. case 3:
  377. days2=365*2;
  378. break;
  379. case 4:
  380. days2=365*3;
  381. break;
  382. case 5:
  383. days2=365*4;
  384. break;
  385. case 6:
  386. days2=365*5;
  387. break;
  388. }
  389. CString stryydate1,stryydate2;
  390. CTime tm=CTime::GetCurrentTime ();
  391. stryydate2=tm.Format ("%Y-%m-%d");
  392. CTimeSpan dt(days2, 0, 0, 0);
  393. tm-=dt;
  394. stryydate1=tm.Format ("%Y-%m-%d");
  395. int money1=0;
  396. int money2=0;
  397. pos=m_combo2.GetCurSel ();
  398. switch(pos)
  399. {
  400. case 1:
  401. money1=0;
  402. money2=999;
  403. break;
  404. case 2:
  405. money1=1000;
  406. money2=1999;
  407. break;
  408. case 3:
  409. money1=2000;
  410. money2=3999;
  411. break;
  412. case 4:
  413. money1=4000;
  414. money2=5999;
  415. break;
  416. case 5:
  417. money1=6000;
  418. money2=9999999;
  419. break;
  420. }
  421. m_pArray->RemoveAll ();
  422. if(mode==0)
  423. {
  424. if(days2 && money2)
  425. {
  426. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  427. {
  428. if(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2)
  429. if(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2)
  430. {
  431. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  432. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  433. {
  434. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  435. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  436. }
  437. }
  438. }
  439. }
  440. else if(days2)
  441. {
  442. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  443. {
  444. if(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2)
  445. {
  446. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  447. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  448. {
  449. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  450. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  451. }
  452. }
  453. }
  454. }
  455. else if( money2)
  456. {
  457. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  458. {
  459. if(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2)
  460. {
  461. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  462. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  463. {
  464. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  465. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  466. }
  467. }
  468. }
  469. }
  470. else
  471. {
  472. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  473. {
  474. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  475. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  476. {
  477. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  478. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  479. }
  480. }
  481. }
  482. }
  483. //3,7
  484. else if(mode==1)//生日
  485. {
  486. CString strdate1,strdate2;
  487. CString strdate1nl,strdate2nl;
  488. CTime tm=CTime::GetCurrentTime ();
  489. strdate1nl=tm.Format ("%Y-%m-%d");
  490. CovertDate2(strdate1nl);
  491. strdate1=tm.Format ("%m-%d");
  492. CTimeSpan dt(m_days, 0, 0, 0);
  493. tm+=dt;
  494. strdate2=tm.Format ("%m-%d");
  495. strdate2nl=tm.Format ("%Y-%m-%d");
  496. CovertDate2(strdate2nl);
  497. if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
  498. if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
  499. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  500. {
  501. if(m_List1array.ElementAt (ii).ElementAt (7)=="0" && m_List1array.ElementAt (ii).ElementAt (3).GetLength ()==10)
  502. {//男,公历
  503. if(days2 && money2)
  504. {
  505. if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
  506. continue;
  507. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
  508. continue;
  509. }
  510. else if(days2)
  511. {
  512. if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
  513. continue;
  514. }
  515. else if(money2)
  516. {
  517. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
  518. continue;
  519. }
  520. if(m_List1array.ElementAt (ii).ElementAt (3).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (3).Right (5)<=strdate2)
  521. {
  522. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  523. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  524. {
  525. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  526. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  527. }
  528. continue;
  529. }
  530. }
  531. if(m_List1array.ElementAt (ii).ElementAt (7)=="1" && (m_List1array.ElementAt (ii).ElementAt (8).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (9).GetLength ()==10))
  532. {//男,农历
  533. if(days2 && money2)
  534. {
  535. if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
  536. continue;
  537. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
  538. continue;
  539. }
  540. else if(days2)
  541. {
  542. if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
  543. continue;
  544. }
  545. else if(money2)
  546. {
  547. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
  548. continue;
  549. }
  550. if(m_List1array.ElementAt (ii).ElementAt (8).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (8).Right (5)<=strdate2nl)
  551. {
  552. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  553. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  554. {
  555. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  556. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  557. }
  558. continue;
  559. }
  560. else if(m_List1array.ElementAt (ii).ElementAt (9).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (9).Right (5)<=strdate2nl)
  561. {
  562. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  563. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  564. {
  565. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  566. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  567. }
  568. continue;
  569. }
  570. }
  571. }
  572. }
  573. m_List1.m_arLabels.SetSize(count, 1);
  574. ii=count;
  575. m_List1.m_LabelCount=ii;
  576. m_List1.SetItemCountEx (ii);
  577. #else
  578. m_oldmode=mode;
  579. UpdateData();
  580. m_List1.DeleteAllItems2 ();
  581. int ii=0;
  582. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  583. int count=0;
  584. int m_days=0;
  585. int pos=m_combo1.GetCurSel ();
  586. switch(pos)
  587. {
  588. case 0:
  589. m_days=0;
  590. break;
  591. case 1:
  592. m_days=2;
  593. break;
  594. case 2:
  595. m_days=3;
  596. break;
  597. case 3:
  598. m_days=5;
  599. break;
  600. case 4:
  601. m_days=7;
  602. break;
  603. case 5:
  604. m_days=15;
  605. break;
  606. case 6:
  607. m_days=30;
  608. break;
  609. }
  610. int days2=0;
  611. pos=m_combo3.GetCurSel ();
  612. switch(pos)
  613. {
  614. case 1:
  615. days2=365/2;
  616. break;
  617. case 2:
  618. days2=365;
  619. break;
  620. case 3:
  621. days2=365*2;
  622. break;
  623. case 4:
  624. days2=365*3;
  625. break;
  626. case 5:
  627. days2=365*4;
  628. break;
  629. case 6:
  630. days2=365*5;
  631. break;
  632. }
  633. CString stryydate1,stryydate2;
  634. CTime tm=CTime::GetCurrentTime ();
  635. stryydate2=tm.Format ("%Y-%m-%d");
  636. CTimeSpan dt(days2, 0, 0, 0);
  637. tm-=dt;
  638. stryydate1=tm.Format ("%Y-%m-%d");
  639. int money1=0;
  640. int money2=0;
  641. pos=m_combo2.GetCurSel ();
  642. switch(pos)
  643. {
  644. case 1:
  645. money1=0;
  646. money2=999;
  647. break;
  648. case 2:
  649. money1=1000;
  650. money2=1999;
  651. break;
  652. case 3:
  653. money1=2000;
  654. money2=3999;
  655. break;
  656. case 4:
  657. money1=4000;
  658. money2=5999;
  659. break;
  660. case 5:
  661. money1=6000;
  662. money2=9999999;
  663. break;
  664. }
  665. m_pArray->RemoveAll ();
  666. if(mode==0)
  667. {
  668. if(days2 && money2)
  669. {
  670. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  671. {
  672. if(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2)
  673. if(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2)
  674. {
  675. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  676. if(m_radio1==0)
  677. {
  678. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  679. {
  680. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  681. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  682. }
  683. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  684. {
  685. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  686. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  687. }
  688. }
  689. else if(m_radio1==1)
  690. {
  691. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  692. {
  693. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  694. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  695. }
  696. }
  697. else if(m_radio1==2)
  698. {
  699. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  700. {
  701. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  702. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  703. }
  704. }
  705. }
  706. }
  707. }
  708. else if(days2)
  709. {
  710. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  711. {
  712. if(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2)
  713. {
  714. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  715. if(m_radio1==0)
  716. {
  717. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  718. {
  719. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  720. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  721. }
  722. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  723. {
  724. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  725. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  726. }
  727. }
  728. else if(m_radio1==1)
  729. {
  730. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  731. {
  732. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  733. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  734. }
  735. }
  736. else if(m_radio1==2)
  737. {
  738. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  739. {
  740. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  741. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  742. }
  743. }
  744. }
  745. }
  746. }
  747. else if( money2)
  748. {
  749. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  750. {
  751. if(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2)
  752. {
  753. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  754. if(m_radio1==0)
  755. {
  756. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  757. {
  758. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  759. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  760. }
  761. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  762. {
  763. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  764. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  765. }
  766. }
  767. else if(m_radio1==1)
  768. {
  769. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  770. {
  771. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  772. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  773. }
  774. }
  775. else if(m_radio1==2)
  776. {
  777. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  778. {
  779. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  780. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  781. }
  782. }
  783. }
  784. }
  785. }
  786. else
  787. {
  788. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  789. {
  790. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  791. if(m_radio1==0)
  792. {
  793. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  794. {
  795. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  796. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  797. }
  798. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  799. {
  800. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  801. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  802. }
  803. }
  804. else if(m_radio1==1)
  805. {
  806. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  807. {
  808. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  809. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  810. }
  811. }
  812. else if(m_radio1==2)
  813. {
  814. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  815. {
  816. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  817. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  818. }
  819. }
  820. }
  821. }
  822. }
  823. //13,14,15,16,17,18
  824. else if(mode==1)//生日
  825. {
  826. CString strdate1,strdate2;
  827. CString strdate1nl,strdate2nl;
  828. CTime tm=CTime::GetCurrentTime ();
  829. strdate1nl=tm.Format ("%Y-%m-%d");
  830. CovertDate2(strdate1nl);
  831. strdate1=tm.Format ("%m-%d");
  832. CTimeSpan dt(m_days, 0, 0, 0);
  833. tm+=dt;
  834. strdate2=tm.Format ("%m-%d");
  835. strdate2nl=tm.Format ("%Y-%m-%d");
  836. CovertDate2(strdate2nl);
  837. if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
  838. if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
  839. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  840. {
  841. if(m_List1array.ElementAt (ii).ElementAt (10)=="0" && m_List1array.ElementAt (ii).ElementAt (5).GetLength ()==10)
  842. {//男,公历
  843. if(days2 && money2)
  844. {
  845. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  846. continue;
  847. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  848. continue;
  849. }
  850. else if(days2)
  851. {
  852. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  853. continue;
  854. }
  855. else if(money2)
  856. {
  857. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  858. continue;
  859. }
  860. if(m_List1array.ElementAt (ii).ElementAt (5).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (5).Right (5)<=strdate2)
  861. {
  862. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  863. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  864. {
  865. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  866. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  867. }
  868. continue;
  869. }
  870. }
  871. if(m_List1array.ElementAt (ii).ElementAt (11)=="0" && m_List1array.ElementAt (ii).ElementAt (6).GetLength ()==10)
  872. {//女,公历
  873. if(days2 && money2)
  874. {
  875. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  876. continue;
  877. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  878. continue;
  879. }
  880. else if(days2)
  881. {
  882. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  883. continue;
  884. }
  885. else if(money2)
  886. {
  887. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  888. continue;
  889. }
  890. if(m_List1array.ElementAt (ii).ElementAt (6).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (6).Right (5)<=strdate2)
  891. {
  892. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  893. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  894. {
  895. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  896. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  897. }
  898. continue;
  899. }
  900. }
  901. if(m_List1array.ElementAt (ii).ElementAt (10)=="1" && (m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10))
  902. {//男,农历
  903. if(days2 && money2)
  904. {
  905. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  906. continue;
  907. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  908. continue;
  909. }
  910. else if(days2)
  911. {
  912. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  913. continue;
  914. }
  915. else if(money2)
  916. {
  917. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  918. continue;
  919. }
  920. if(m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10)
  921. {
  922. if(m_List1array.ElementAt (ii).ElementAt (13).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (13).Right (5)<=strdate2nl)
  923. {
  924. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  925. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  926. {
  927. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  928. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  929. }
  930. continue;
  931. }
  932. }
  933. if(m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10)
  934. {
  935. if(m_List1array.ElementAt (ii).ElementAt (14).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (14).Right (5)<=strdate2nl)
  936. {
  937. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  938. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  939. {
  940. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  941. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  942. }
  943. continue;
  944. }
  945. }
  946. }
  947. if(m_List1array.ElementAt (ii).ElementAt (11)=="1" && (m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10))
  948. {//女,农历
  949. if(days2 && money2)
  950. {
  951. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  952. continue;
  953. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  954. continue;
  955. }
  956. else if(days2)
  957. {
  958. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  959. continue;
  960. }
  961. else if(money2)
  962. {
  963. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  964. continue;
  965. }
  966. if(m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10)
  967. {
  968. if(m_List1array.ElementAt (ii).ElementAt (15).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (15).Right (5)<=strdate2nl)
  969. {
  970. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  971. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  972. {
  973. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  974. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  975. }
  976. continue;
  977. }
  978. }
  979. if(m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10)
  980. {
  981. if(m_List1array.ElementAt (ii).ElementAt (16).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (16).Right (5)<=strdate2nl)
  982. {
  983. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  984. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  985. {
  986. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  987. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  988. }
  989. continue;
  990. }
  991. }
  992. }
  993. }
  994. }
  995. else if(mode==2)//结婚纪念
  996. {
  997. CString strdate1,strdate2;
  998. CString strdate1nl,strdate2nl;
  999. CTime tm=CTime::GetCurrentTime ();
  1000. strdate1nl=tm.Format ("%Y-%m-%d");
  1001. CovertDate2(strdate1nl);
  1002. strdate1=tm.Format ("%m-%d");
  1003. CTimeSpan dt(m_days, 0, 0, 0);
  1004. tm+=dt;
  1005. strdate2=tm.Format ("%m-%d");
  1006. strdate2nl=tm.Format ("%Y-%m-%d");
  1007. CovertDate2(strdate2nl);
  1008. if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
  1009. if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
  1010. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  1011. {
  1012. if(m_List1array.ElementAt (ii).ElementAt (12)=="0" && m_List1array.ElementAt (ii).ElementAt (4).GetLength ()==10)
  1013. {//结婚纪念,公历
  1014. if(m_List1array.ElementAt (ii).ElementAt (4).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (4).Right (5)<=strdate2)
  1015. {
  1016. if(days2 && money2)
  1017. {
  1018. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1019. continue;
  1020. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1021. continue;
  1022. }
  1023. else if(days2)
  1024. {
  1025. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1026. continue;
  1027. }
  1028. else if(money2)
  1029. {
  1030. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1031. continue;
  1032. }
  1033. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1034. if(m_radio1==0)
  1035. {
  1036. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1037. {
  1038. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1039. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1040. }
  1041. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1042. {
  1043. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1044. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1045. }
  1046. }
  1047. else if(m_radio1==1)
  1048. {
  1049. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1050. {
  1051. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1052. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1053. }
  1054. }
  1055. else if(m_radio1==2)
  1056. {
  1057. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1058. {
  1059. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1060. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1061. }
  1062. }
  1063. }
  1064. }
  1065. 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) )
  1066. {//结婚纪念,农历
  1067. if(m_List1array.ElementAt (ii).ElementAt (17).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (17).Right (5)<=strdate2nl)
  1068. {
  1069. if(days2 && money2)
  1070. {
  1071. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1072. continue;
  1073. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1074. continue;
  1075. }
  1076. else if(days2)
  1077. {
  1078. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1079. continue;
  1080. }
  1081. else if(money2)
  1082. {
  1083. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1084. continue;
  1085. }
  1086. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1087. if(m_radio1==0)
  1088. {
  1089. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1090. {
  1091. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1092. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1093. }
  1094. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1095. {
  1096. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1097. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1098. }
  1099. }
  1100. else if(m_radio1==1)
  1101. {
  1102. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1103. {
  1104. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1105. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1106. }
  1107. }
  1108. else if(m_radio1==2)
  1109. {
  1110. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1111. {
  1112. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1113. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1114. }
  1115. }
  1116. }
  1117. else if(m_List1array.ElementAt (ii).ElementAt (18).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (18).Right (5)<=strdate2nl)
  1118. {
  1119. if(days2 && money2)
  1120. {
  1121. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1122. continue;
  1123. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1124. continue;
  1125. }
  1126. else if(days2)
  1127. {
  1128. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1129. continue;
  1130. }
  1131. else if(money2)
  1132. {
  1133. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1134. continue;
  1135. }
  1136. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1137. if(m_radio1==0)
  1138. {
  1139. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1140. {
  1141. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1142. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1143. }
  1144. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1145. {
  1146. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1147. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1148. }
  1149. }
  1150. else if(m_radio1==1)
  1151. {
  1152. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1153. {
  1154. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1155. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1156. }
  1157. }
  1158. else if(m_radio1==2)
  1159. {
  1160. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1161. {
  1162. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1163. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1164. }
  1165. }
  1166. }
  1167. }
  1168. }
  1169. }
  1170. else if(mode==3)//生日+结婚纪念
  1171. {
  1172. CString strdate1,strdate2;
  1173. CString strdate1nl,strdate2nl;
  1174. CTime tm=CTime::GetCurrentTime ();
  1175. strdate1nl=tm.Format ("%Y-%m-%d");
  1176. CovertDate2(strdate1nl);
  1177. strdate1=tm.Format ("%m-%d");
  1178. CTimeSpan dt(m_days, 0, 0, 0);
  1179. tm+=dt;
  1180. strdate2=tm.Format ("%m-%d");
  1181. strdate2nl=tm.Format ("%Y-%m-%d");
  1182. CovertDate2(strdate2nl);
  1183. if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
  1184. if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
  1185. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  1186. {
  1187. if(days2 && money2)
  1188. {
  1189. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1190. continue;
  1191. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1192. continue;
  1193. }
  1194. else if(days2)
  1195. {
  1196. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1197. continue;
  1198. }
  1199. else if(money2)
  1200. {
  1201. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1202. continue;
  1203. }
  1204. BOOL bAdded=0;
  1205. if(m_List1array.ElementAt (ii).ElementAt (10)=="0" && m_List1array.ElementAt (ii).ElementAt (5).GetLength ()==10)
  1206. {//男,公历
  1207. if(m_List1array.ElementAt (ii).ElementAt (5).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (5).Right (5)<=strdate2)
  1208. {
  1209. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1210. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1211. {
  1212. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1213. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1214. }
  1215. continue;
  1216. }
  1217. }
  1218. if(m_List1array.ElementAt (ii).ElementAt (11)=="0" && m_List1array.ElementAt (ii).ElementAt (6).GetLength ()==10)
  1219. {//女,公历
  1220. if(m_List1array.ElementAt (ii).ElementAt (6).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (6).Right (5)<=strdate2)
  1221. {
  1222. if(bAdded==0)
  1223. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1224. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1225. {
  1226. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1227. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1228. }
  1229. continue;
  1230. }
  1231. }
  1232. if(m_List1array.ElementAt (ii).ElementAt (10)=="1" && (m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10))
  1233. {//男,农历
  1234. if(m_List1array.ElementAt (ii).ElementAt (13).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (13).Right (5)<=strdate2nl)
  1235. {
  1236. if(bAdded==0)
  1237. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1238. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1239. {
  1240. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1241. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1242. }
  1243. }
  1244. else if(m_List1array.ElementAt (ii).ElementAt (14).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (14).Right (5)<=strdate2nl)
  1245. {
  1246. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1247. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1248. {
  1249. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1250. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1251. }
  1252. }
  1253. }
  1254. if(m_List1array.ElementAt (ii).ElementAt (11)=="1" && (m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10))
  1255. {//女,农历
  1256. if(m_List1array.ElementAt (ii).ElementAt (15).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (15).Right (5)<=strdate2nl)
  1257. {
  1258. if(bAdded==0)
  1259. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1260. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1261. {
  1262. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1263. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1264. }
  1265. }
  1266. else if(m_List1array.ElementAt (ii).ElementAt (16).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (16).Right (5)<=strdate2nl)
  1267. {
  1268. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1269. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1270. {
  1271. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1272. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1273. }
  1274. }
  1275. }
  1276. if(m_List1array.ElementAt (ii).ElementAt (12)=="0" && m_List1array.ElementAt (ii).ElementAt (4).GetLength ()==10)
  1277. {//结婚纪念,公历
  1278. if(m_List1array.ElementAt (ii).ElementAt (4).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (4).Right (5)<=strdate2)
  1279. {
  1280. if(bAdded==0)
  1281. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1282. if(m_radio1==0)
  1283. {
  1284. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1285. {
  1286. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1287. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1288. }
  1289. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1290. {
  1291. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1292. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1293. }
  1294. }
  1295. else if(m_radio1==1)
  1296. {
  1297. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1298. {
  1299. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1300. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1301. }
  1302. }
  1303. else if(m_radio1==2)
  1304. {
  1305. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1306. {
  1307. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1308. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1309. }
  1310. }
  1311. }
  1312. }
  1313. 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) )
  1314. {//结婚纪念,农历
  1315. if(m_List1array.ElementAt (ii).ElementAt (17).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (17).Right (5)<=strdate2nl)
  1316. {
  1317. if(bAdded==0)
  1318. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1319. if(m_radio1==0)
  1320. {
  1321. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1322. {
  1323. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1324. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1325. }
  1326. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1327. {
  1328. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1329. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1330. }
  1331. }
  1332. else if(m_radio1==1)
  1333. {
  1334. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1335. {
  1336. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1337. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1338. }
  1339. }
  1340. else if(m_radio1==2)
  1341. {
  1342. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1343. {
  1344. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1345. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1346. }
  1347. }
  1348. }
  1349. else if(m_List1array.ElementAt (ii).ElementAt (18).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (18).Right (5)<=strdate2nl)
  1350. {
  1351. if(bAdded==0)
  1352. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1353. if(m_radio1==0)
  1354. {
  1355. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1356. {
  1357. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1358. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1359. }
  1360. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1361. {
  1362. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1363. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1364. }
  1365. }
  1366. else if(m_radio1==1)
  1367. {
  1368. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1369. {
  1370. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1371. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1372. }
  1373. }
  1374. else if(m_radio1==2)
  1375. {
  1376. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1377. {
  1378. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1379. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1380. }
  1381. }
  1382. }
  1383. }
  1384. }
  1385. }
  1386. m_List1.m_arLabels.SetSize(count, 1);
  1387. ii=count;
  1388. m_List1.m_LabelCount=ii;
  1389. m_List1.SetItemCountEx (ii);
  1390. #endif
  1391. }
  1392. void GetPhone::OnButton1()
  1393. {
  1394. // TODO: Add your control notification handler code here
  1395. FillGrid(0);
  1396. }
  1397. void GetPhone::OnButton2()
  1398. {
  1399. // TODO: Add your control notification handler code here
  1400. FillGrid(1);
  1401. }
  1402. void GetPhone::OnButton3()
  1403. {
  1404. // TODO: Add your control notification handler code here
  1405. FillGrid(2);
  1406. }
  1407. void GetPhone::OnButton4()
  1408. {
  1409. // TODO: Add your control notification handler code here
  1410. FillGrid(3);
  1411. }
  1412. void GetPhone::OnRadio1()
  1413. {
  1414. // TODO: Add your control notification handler code here
  1415. FillGrid(m_oldmode);
  1416. }
  1417. void GetPhone::OnRadio2()
  1418. {
  1419. // TODO: Add your control notification handler code here
  1420. FillGrid(m_oldmode);
  1421. }
  1422. void GetPhone::OnRadio3()
  1423. {
  1424. // TODO: Add your control notification handler code here
  1425. FillGrid(m_oldmode);
  1426. }
  1427. void GetPhone::OnCloseupCombo2()
  1428. {
  1429. // TODO: Add your control notification handler code here
  1430. FillGrid(m_oldmode);
  1431. }
  1432. void GetPhone::OnCloseupCombo3()
  1433. {
  1434. // TODO: Add your control notification handler code here
  1435. FillGrid(m_oldmode);
  1436. }
  1437. void GetPhone::OnCloseupCombo1()
  1438. {
  1439. // TODO: Add your control notification handler code here
  1440. if(m_oldmode)
  1441. FillGrid(m_oldmode);
  1442. }