GetPhone.cpp 46 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 g_nYearposTemp=g_nYearpos;
  231. for(int i=0; i< g_hisyeararray.GetSize (); i++)
  232. {
  233. if(i>=9)break;
  234. g_nYearpos=i;
  235. g_sendhead.bsql=0;
  236. g_sendhead.code[0]=64;
  237. g_sendhead.tabcount=1;
  238. g_pMainWnd->ProcessChatMessageRequest2(15);
  239. if(g_bSendOK==0)
  240. {
  241. g_nYearpos=g_nYearposTemp;
  242. return true;
  243. }
  244. DataToArray(&(List1array[i+1]));
  245. }
  246. g_nYearpos=g_nYearposTemp;
  247. // AfxMessageBox("22");
  248. int size=0;
  249. for(i=0; i<10; i++)
  250. {
  251. size+=List1array[i].GetSize ();
  252. }
  253. m_List1array.SetSize(size);
  254. int pos=0;
  255. for(i=0; i<10; i++)
  256. {
  257. if(List1array[i].GetSize ()==0)continue;
  258. for(int a=0; a<List1array[i].GetSize (); a++)
  259. {
  260. m_List1array.ElementAt (pos).Copy (List1array[i].ElementAt (a));
  261. pos++;
  262. }
  263. }
  264. // CString check1date=Listarray2.ElementAt (a).ElementAt (10);
  265. // CString check2date=Listarray2.ElementAt (a).ElementAt (11);
  266. // CString check3date=Listarray2.ElementAt (a).ElementAt (12);
  267. #ifndef CHILD_VERSION
  268. CString date1,date2;
  269. for(i=0; i<m_List1array.GetSize (); i++)
  270. {
  271. if(m_List1array.ElementAt (i).ElementAt (10)=="1")
  272. {
  273. date1=m_List1array.ElementAt (i).ElementAt (5);
  274. // CovertDate(date1,date2);
  275. m_List1array.ElementAt (i).Add (date1);
  276. m_List1array.ElementAt (i).Add (date2);
  277. }
  278. else
  279. {
  280. m_List1array.ElementAt (i).Add ("");
  281. m_List1array.ElementAt (i).Add ("");
  282. }
  283. if(m_List1array.ElementAt (i).ElementAt (11)=="1")
  284. {
  285. date1=m_List1array.ElementAt (i).ElementAt (6);
  286. // CovertDate(date1,date2);
  287. m_List1array.ElementAt (i).Add (date1);
  288. m_List1array.ElementAt (i).Add (date2);
  289. }
  290. else
  291. {
  292. m_List1array.ElementAt (i).Add ("");
  293. m_List1array.ElementAt (i).Add ("");
  294. }
  295. if(m_List1array.ElementAt (i).ElementAt (12)=="1")
  296. {
  297. date1=m_List1array.ElementAt (i).ElementAt (4);
  298. // CovertDate(date1,date2);
  299. m_List1array.ElementAt (i).Add (date1);
  300. m_List1array.ElementAt (i).Add (date2);
  301. }
  302. else
  303. {
  304. m_List1array.ElementAt (i).Add ("");
  305. m_List1array.ElementAt (i).Add ("");
  306. }
  307. }
  308. #else
  309. CString date1,date2;
  310. for(i=0; i<m_List1array.GetSize (); i++)
  311. {
  312. if(m_List1array.ElementAt (i).ElementAt (7)=="1")
  313. {
  314. date1=m_List1array.ElementAt (i).ElementAt (3);
  315. // CovertDate(date1,date2);
  316. m_List1array.ElementAt (i).Add (date1);
  317. m_List1array.ElementAt (i).Add (date2);
  318. }
  319. else
  320. {
  321. m_List1array.ElementAt (i).Add ("");
  322. m_List1array.ElementAt (i).Add ("");
  323. }
  324. }
  325. #endif
  326. return TRUE; // return TRUE unless you set the focus to a control
  327. // EXCEPTION: OCX Property Pages should return FALSE
  328. }
  329. //messagebox
  330. void GetPhone::FillGrid(int mode)
  331. {
  332. #ifdef CHILD_VERSION
  333. m_oldmode=mode;
  334. UpdateData();
  335. m_List1.DeleteAllItems2 ();
  336. int ii=0;
  337. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  338. int count=0;
  339. int m_days=0;
  340. int pos=m_combo1.GetCurSel ();
  341. switch(pos)
  342. {
  343. case 0:
  344. m_days=0;
  345. break;
  346. case 1:
  347. m_days=2;
  348. break;
  349. case 2:
  350. m_days=3;
  351. break;
  352. case 3:
  353. m_days=5;
  354. break;
  355. case 4:
  356. m_days=7;
  357. break;
  358. case 5:
  359. m_days=15;
  360. break;
  361. case 6:
  362. m_days=30;
  363. break;
  364. }
  365. int days2=0;
  366. pos=m_combo3.GetCurSel ();
  367. switch(pos)
  368. {
  369. case 1:
  370. days2=365/2;
  371. break;
  372. case 2:
  373. days2=365;
  374. break;
  375. case 3:
  376. days2=365*2;
  377. break;
  378. case 4:
  379. days2=365*3;
  380. break;
  381. case 5:
  382. days2=365*4;
  383. break;
  384. case 6:
  385. days2=365*5;
  386. break;
  387. }
  388. CString stryydate1,stryydate2;
  389. CTime tm=CTime::GetCurrentTime ();
  390. stryydate2=tm.Format ("%Y-%m-%d");
  391. CTimeSpan dt(days2, 0, 0, 0);
  392. tm-=dt;
  393. stryydate1=tm.Format ("%Y-%m-%d");
  394. int money1=0;
  395. int money2=0;
  396. pos=m_combo2.GetCurSel ();
  397. switch(pos)
  398. {
  399. case 1:
  400. money1=0;
  401. money2=999;
  402. break;
  403. case 2:
  404. money1=1000;
  405. money2=1999;
  406. break;
  407. case 3:
  408. money1=2000;
  409. money2=3999;
  410. break;
  411. case 4:
  412. money1=4000;
  413. money2=5999;
  414. break;
  415. case 5:
  416. money1=6000;
  417. money2=9999999;
  418. break;
  419. }
  420. m_pArray->RemoveAll ();
  421. if(mode==0)
  422. {
  423. if(days2 && money2)
  424. {
  425. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  426. {
  427. if(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2)
  428. if(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2)
  429. {
  430. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  431. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  432. {
  433. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  434. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  435. }
  436. }
  437. }
  438. }
  439. else if(days2)
  440. {
  441. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  442. {
  443. if(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2)
  444. {
  445. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  446. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  447. {
  448. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  449. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  450. }
  451. }
  452. }
  453. }
  454. else if( money2)
  455. {
  456. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  457. {
  458. if(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2)
  459. {
  460. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  461. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  462. {
  463. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  464. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  465. }
  466. }
  467. }
  468. }
  469. else
  470. {
  471. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  472. {
  473. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  474. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  475. {
  476. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  477. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  478. }
  479. }
  480. }
  481. }
  482. //3,7
  483. else if(mode==1)//生日
  484. {
  485. CString strdate1,strdate2;
  486. CString strdate1nl,strdate2nl;
  487. CTime tm=CTime::GetCurrentTime ();
  488. strdate1nl=tm.Format ("%Y-%m-%d");
  489. CovertDate2(strdate1nl);
  490. strdate1=tm.Format ("%m-%d");
  491. CTimeSpan dt(m_days, 0, 0, 0);
  492. tm+=dt;
  493. strdate2=tm.Format ("%m-%d");
  494. strdate2nl=tm.Format ("%Y-%m-%d");
  495. CovertDate2(strdate2nl);
  496. if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
  497. if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
  498. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  499. {
  500. if(m_List1array.ElementAt (ii).ElementAt (7)=="0" && m_List1array.ElementAt (ii).ElementAt (3).GetLength ()==10)
  501. {//男,公历
  502. if(days2 && money2)
  503. {
  504. if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
  505. continue;
  506. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
  507. continue;
  508. }
  509. else if(days2)
  510. {
  511. if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
  512. continue;
  513. }
  514. else if(money2)
  515. {
  516. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
  517. continue;
  518. }
  519. if(m_List1array.ElementAt (ii).ElementAt (3).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (3).Right (5)<=strdate2)
  520. {
  521. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  522. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  523. {
  524. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  525. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  526. }
  527. continue;
  528. }
  529. }
  530. if(m_List1array.ElementAt (ii).ElementAt (7)=="1" && (m_List1array.ElementAt (ii).ElementAt (8).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (9).GetLength ()==10))
  531. {//男,农历
  532. if(days2 && money2)
  533. {
  534. if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
  535. continue;
  536. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
  537. continue;
  538. }
  539. else if(days2)
  540. {
  541. if( !(m_List1array.ElementAt (ii).ElementAt (6)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (6)<=stryydate2))
  542. continue;
  543. }
  544. else if(money2)
  545. {
  546. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (5))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (5))<=money2))
  547. continue;
  548. }
  549. if(m_List1array.ElementAt (ii).ElementAt (8).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (8).Right (5)<=strdate2nl)
  550. {
  551. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  552. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  553. {
  554. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  555. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  556. }
  557. continue;
  558. }
  559. else if(m_List1array.ElementAt (ii).ElementAt (9).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (9).Right (5)<=strdate2nl)
  560. {
  561. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  562. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  563. {
  564. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  565. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  566. }
  567. continue;
  568. }
  569. }
  570. }
  571. }
  572. m_List1.m_arLabels.SetSize(count, 1);
  573. ii=count;
  574. m_List1.m_LabelCount=ii;
  575. m_List1.SetItemCountEx (ii);
  576. #else
  577. m_oldmode=mode;
  578. UpdateData();
  579. m_List1.DeleteAllItems2 ();
  580. int ii=0;
  581. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  582. int count=0;
  583. int m_days=0;
  584. int pos=m_combo1.GetCurSel ();
  585. switch(pos)
  586. {
  587. case 0:
  588. m_days=0;
  589. break;
  590. case 1:
  591. m_days=2;
  592. break;
  593. case 2:
  594. m_days=3;
  595. break;
  596. case 3:
  597. m_days=5;
  598. break;
  599. case 4:
  600. m_days=7;
  601. break;
  602. case 5:
  603. m_days=15;
  604. break;
  605. case 6:
  606. m_days=30;
  607. break;
  608. }
  609. int days2=0;
  610. pos=m_combo3.GetCurSel ();
  611. switch(pos)
  612. {
  613. case 1:
  614. days2=365/2;
  615. break;
  616. case 2:
  617. days2=365;
  618. break;
  619. case 3:
  620. days2=365*2;
  621. break;
  622. case 4:
  623. days2=365*3;
  624. break;
  625. case 5:
  626. days2=365*4;
  627. break;
  628. case 6:
  629. days2=365*5;
  630. break;
  631. }
  632. CString stryydate1,stryydate2;
  633. CTime tm=CTime::GetCurrentTime ();
  634. stryydate2=tm.Format ("%Y-%m-%d");
  635. CTimeSpan dt(days2, 0, 0, 0);
  636. tm-=dt;
  637. stryydate1=tm.Format ("%Y-%m-%d");
  638. int money1=0;
  639. int money2=0;
  640. pos=m_combo2.GetCurSel ();
  641. switch(pos)
  642. {
  643. case 1:
  644. money1=0;
  645. money2=999;
  646. break;
  647. case 2:
  648. money1=1000;
  649. money2=1999;
  650. break;
  651. case 3:
  652. money1=2000;
  653. money2=3999;
  654. break;
  655. case 4:
  656. money1=4000;
  657. money2=5999;
  658. break;
  659. case 5:
  660. money1=6000;
  661. money2=9999999;
  662. break;
  663. }
  664. m_pArray->RemoveAll ();
  665. if(mode==0)
  666. {
  667. if(days2 && money2)
  668. {
  669. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  670. {
  671. if(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2)
  672. if(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2)
  673. {
  674. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  675. if(m_radio1==0)
  676. {
  677. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  678. {
  679. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  680. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  681. }
  682. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  683. {
  684. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  685. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  686. }
  687. }
  688. else if(m_radio1==1)
  689. {
  690. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  691. {
  692. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  693. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  694. }
  695. }
  696. else if(m_radio1==2)
  697. {
  698. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  699. {
  700. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  701. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  702. }
  703. }
  704. }
  705. }
  706. }
  707. else if(days2)
  708. {
  709. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  710. {
  711. if(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2)
  712. {
  713. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  714. if(m_radio1==0)
  715. {
  716. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  717. {
  718. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  719. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  720. }
  721. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  722. {
  723. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  724. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  725. }
  726. }
  727. else if(m_radio1==1)
  728. {
  729. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  730. {
  731. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  732. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  733. }
  734. }
  735. else if(m_radio1==2)
  736. {
  737. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  738. {
  739. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  740. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  741. }
  742. }
  743. }
  744. }
  745. }
  746. else if( money2)
  747. {
  748. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  749. {
  750. if(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2)
  751. {
  752. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  753. if(m_radio1==0)
  754. {
  755. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  756. {
  757. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  758. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  759. }
  760. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  761. {
  762. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  763. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  764. }
  765. }
  766. else if(m_radio1==1)
  767. {
  768. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  769. {
  770. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  771. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  772. }
  773. }
  774. else if(m_radio1==2)
  775. {
  776. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  777. {
  778. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  779. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  780. }
  781. }
  782. }
  783. }
  784. }
  785. else
  786. {
  787. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  788. {
  789. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  790. if(m_radio1==0)
  791. {
  792. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  793. {
  794. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  795. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  796. }
  797. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  798. {
  799. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  800. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  801. }
  802. }
  803. else if(m_radio1==1)
  804. {
  805. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  806. {
  807. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  808. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  809. }
  810. }
  811. else if(m_radio1==2)
  812. {
  813. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  814. {
  815. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  816. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  817. }
  818. }
  819. }
  820. }
  821. }
  822. //13,14,15,16,17,18
  823. else if(mode==1)//生日
  824. {
  825. CString strdate1,strdate2;
  826. CString strdate1nl,strdate2nl;
  827. CTime tm=CTime::GetCurrentTime ();
  828. strdate1nl=tm.Format ("%Y-%m-%d");
  829. CovertDate2(strdate1nl);
  830. strdate1=tm.Format ("%m-%d");
  831. CTimeSpan dt(m_days, 0, 0, 0);
  832. tm+=dt;
  833. strdate2=tm.Format ("%m-%d");
  834. strdate2nl=tm.Format ("%Y-%m-%d");
  835. CovertDate2(strdate2nl);
  836. if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
  837. if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
  838. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  839. {
  840. if(m_List1array.ElementAt (ii).ElementAt (10)=="0" && m_List1array.ElementAt (ii).ElementAt (5).GetLength ()==10)
  841. {//男,公历
  842. if(days2 && money2)
  843. {
  844. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  845. continue;
  846. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  847. continue;
  848. }
  849. else if(days2)
  850. {
  851. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  852. continue;
  853. }
  854. else if(money2)
  855. {
  856. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  857. continue;
  858. }
  859. if(m_List1array.ElementAt (ii).ElementAt (5).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (5).Right (5)<=strdate2)
  860. {
  861. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  862. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  863. {
  864. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  865. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  866. }
  867. continue;
  868. }
  869. }
  870. if(m_List1array.ElementAt (ii).ElementAt (11)=="0" && m_List1array.ElementAt (ii).ElementAt (6).GetLength ()==10)
  871. {//女,公历
  872. if(days2 && money2)
  873. {
  874. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  875. continue;
  876. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  877. continue;
  878. }
  879. else if(days2)
  880. {
  881. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  882. continue;
  883. }
  884. else if(money2)
  885. {
  886. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  887. continue;
  888. }
  889. if(m_List1array.ElementAt (ii).ElementAt (6).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (6).Right (5)<=strdate2)
  890. {
  891. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  892. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  893. {
  894. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  895. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  896. }
  897. continue;
  898. }
  899. }
  900. if(m_List1array.ElementAt (ii).ElementAt (10)=="1" && (m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10))
  901. {//男,农历
  902. if(days2 && money2)
  903. {
  904. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  905. continue;
  906. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  907. continue;
  908. }
  909. else if(days2)
  910. {
  911. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  912. continue;
  913. }
  914. else if(money2)
  915. {
  916. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  917. continue;
  918. }
  919. if(m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10)
  920. {
  921. if(m_List1array.ElementAt (ii).ElementAt (13).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (13).Right (5)<=strdate2nl)
  922. {
  923. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  924. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  925. {
  926. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  927. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  928. }
  929. continue;
  930. }
  931. }
  932. if(m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10)
  933. {
  934. if(m_List1array.ElementAt (ii).ElementAt (14).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (14).Right (5)<=strdate2nl)
  935. {
  936. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  937. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  938. {
  939. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  940. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  941. }
  942. continue;
  943. }
  944. }
  945. }
  946. if(m_List1array.ElementAt (ii).ElementAt (11)=="1" && (m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10))
  947. {//女,农历
  948. if(days2 && money2)
  949. {
  950. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  951. continue;
  952. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  953. continue;
  954. }
  955. else if(days2)
  956. {
  957. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  958. continue;
  959. }
  960. else if(money2)
  961. {
  962. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  963. continue;
  964. }
  965. if(m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10)
  966. {
  967. if(m_List1array.ElementAt (ii).ElementAt (15).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (15).Right (5)<=strdate2nl)
  968. {
  969. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  970. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  971. {
  972. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  973. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  974. }
  975. continue;
  976. }
  977. }
  978. if(m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10)
  979. {
  980. if(m_List1array.ElementAt (ii).ElementAt (16).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (16).Right (5)<=strdate2nl)
  981. {
  982. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  983. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  984. {
  985. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  986. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  987. }
  988. continue;
  989. }
  990. }
  991. }
  992. }
  993. }
  994. else if(mode==2)//结婚纪念
  995. {
  996. CString strdate1,strdate2;
  997. CString strdate1nl,strdate2nl;
  998. CTime tm=CTime::GetCurrentTime ();
  999. strdate1nl=tm.Format ("%Y-%m-%d");
  1000. CovertDate2(strdate1nl);
  1001. strdate1=tm.Format ("%m-%d");
  1002. CTimeSpan dt(m_days, 0, 0, 0);
  1003. tm+=dt;
  1004. strdate2=tm.Format ("%m-%d");
  1005. strdate2nl=tm.Format ("%Y-%m-%d");
  1006. CovertDate2(strdate2nl);
  1007. if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
  1008. if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
  1009. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  1010. {
  1011. if(m_List1array.ElementAt (ii).ElementAt (12)=="0" && m_List1array.ElementAt (ii).ElementAt (4).GetLength ()==10)
  1012. {//结婚纪念,公历
  1013. if(m_List1array.ElementAt (ii).ElementAt (4).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (4).Right (5)<=strdate2)
  1014. {
  1015. if(days2 && money2)
  1016. {
  1017. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1018. continue;
  1019. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1020. continue;
  1021. }
  1022. else if(days2)
  1023. {
  1024. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1025. continue;
  1026. }
  1027. else if(money2)
  1028. {
  1029. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1030. continue;
  1031. }
  1032. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1033. if(m_radio1==0)
  1034. {
  1035. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1036. {
  1037. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1038. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1039. }
  1040. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1041. {
  1042. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1043. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1044. }
  1045. }
  1046. else if(m_radio1==1)
  1047. {
  1048. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1049. {
  1050. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1051. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1052. }
  1053. }
  1054. else if(m_radio1==2)
  1055. {
  1056. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1057. {
  1058. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1059. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1060. }
  1061. }
  1062. }
  1063. }
  1064. 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) )
  1065. {//结婚纪念,农历
  1066. if(m_List1array.ElementAt (ii).ElementAt (17).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (17).Right (5)<=strdate2nl)
  1067. {
  1068. if(days2 && money2)
  1069. {
  1070. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1071. continue;
  1072. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1073. continue;
  1074. }
  1075. else if(days2)
  1076. {
  1077. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1078. continue;
  1079. }
  1080. else if(money2)
  1081. {
  1082. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1083. continue;
  1084. }
  1085. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1086. if(m_radio1==0)
  1087. {
  1088. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1089. {
  1090. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1091. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1092. }
  1093. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1094. {
  1095. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1096. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1097. }
  1098. }
  1099. else if(m_radio1==1)
  1100. {
  1101. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1102. {
  1103. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1104. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1105. }
  1106. }
  1107. else if(m_radio1==2)
  1108. {
  1109. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1110. {
  1111. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1112. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1113. }
  1114. }
  1115. }
  1116. else if(m_List1array.ElementAt (ii).ElementAt (18).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (18).Right (5)<=strdate2nl)
  1117. {
  1118. if(days2 && money2)
  1119. {
  1120. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1121. continue;
  1122. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1123. continue;
  1124. }
  1125. else if(days2)
  1126. {
  1127. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1128. continue;
  1129. }
  1130. else if(money2)
  1131. {
  1132. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1133. continue;
  1134. }
  1135. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1136. if(m_radio1==0)
  1137. {
  1138. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1139. {
  1140. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1141. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1142. }
  1143. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1144. {
  1145. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1146. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1147. }
  1148. }
  1149. else if(m_radio1==1)
  1150. {
  1151. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1152. {
  1153. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1154. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1155. }
  1156. }
  1157. else if(m_radio1==2)
  1158. {
  1159. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1160. {
  1161. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1162. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1163. }
  1164. }
  1165. }
  1166. }
  1167. }
  1168. }
  1169. else if(mode==3)//生日+结婚纪念
  1170. {
  1171. CString strdate1,strdate2;
  1172. CString strdate1nl,strdate2nl;
  1173. CTime tm=CTime::GetCurrentTime ();
  1174. strdate1nl=tm.Format ("%Y-%m-%d");
  1175. CovertDate2(strdate1nl);
  1176. strdate1=tm.Format ("%m-%d");
  1177. CTimeSpan dt(m_days, 0, 0, 0);
  1178. tm+=dt;
  1179. strdate2=tm.Format ("%m-%d");
  1180. strdate2nl=tm.Format ("%Y-%m-%d");
  1181. CovertDate2(strdate2nl);
  1182. if(strdate1nl.GetLength ()==10)strdate1nl.Delete (0, 5);
  1183. if(strdate2nl.GetLength ()==10)strdate2nl.Delete (0, 5);
  1184. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  1185. {
  1186. if(days2 && money2)
  1187. {
  1188. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1189. continue;
  1190. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1191. continue;
  1192. }
  1193. else if(days2)
  1194. {
  1195. if( !(m_List1array.ElementAt (ii).ElementAt (9)>=stryydate1 && m_List1array.ElementAt (ii).ElementAt (9)<=stryydate2))
  1196. continue;
  1197. }
  1198. else if(money2)
  1199. {
  1200. if( !(atoi(m_List1array.ElementAt (ii).ElementAt (8))>=money1 && atoi(m_List1array.ElementAt (ii).ElementAt (8))<=money2))
  1201. continue;
  1202. }
  1203. BOOL bAdded=0;
  1204. if(m_List1array.ElementAt (ii).ElementAt (10)=="0" && m_List1array.ElementAt (ii).ElementAt (5).GetLength ()==10)
  1205. {//男,公历
  1206. if(m_List1array.ElementAt (ii).ElementAt (5).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (5).Right (5)<=strdate2)
  1207. {
  1208. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1209. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1210. {
  1211. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1212. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1213. }
  1214. continue;
  1215. }
  1216. }
  1217. if(m_List1array.ElementAt (ii).ElementAt (11)=="0" && m_List1array.ElementAt (ii).ElementAt (6).GetLength ()==10)
  1218. {//女,公历
  1219. if(m_List1array.ElementAt (ii).ElementAt (6).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (6).Right (5)<=strdate2)
  1220. {
  1221. if(bAdded==0)
  1222. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1223. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1224. {
  1225. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1226. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1227. }
  1228. continue;
  1229. }
  1230. }
  1231. if(m_List1array.ElementAt (ii).ElementAt (10)=="1" && (m_List1array.ElementAt (ii).ElementAt (13).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (14).GetLength ()==10))
  1232. {//男,农历
  1233. if(m_List1array.ElementAt (ii).ElementAt (13).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (13).Right (5)<=strdate2nl)
  1234. {
  1235. if(bAdded==0)
  1236. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1237. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1238. {
  1239. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1240. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1241. }
  1242. }
  1243. else if(m_List1array.ElementAt (ii).ElementAt (14).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (14).Right (5)<=strdate2nl)
  1244. {
  1245. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1246. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1247. {
  1248. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1249. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1250. }
  1251. }
  1252. }
  1253. if(m_List1array.ElementAt (ii).ElementAt (11)=="1" && (m_List1array.ElementAt (ii).ElementAt (15).GetLength ()==10||m_List1array.ElementAt (ii).ElementAt (16).GetLength ()==10))
  1254. {//女,农历
  1255. if(m_List1array.ElementAt (ii).ElementAt (15).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (15).Right (5)<=strdate2nl)
  1256. {
  1257. if(bAdded==0)
  1258. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1259. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1260. {
  1261. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1262. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1263. }
  1264. }
  1265. else if(m_List1array.ElementAt (ii).ElementAt (16).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (16).Right (5)<=strdate2nl)
  1266. {
  1267. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));bAdded=1;
  1268. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1269. {
  1270. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1271. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1272. }
  1273. }
  1274. }
  1275. if(m_List1array.ElementAt (ii).ElementAt (12)=="0" && m_List1array.ElementAt (ii).ElementAt (4).GetLength ()==10)
  1276. {//结婚纪念,公历
  1277. if(m_List1array.ElementAt (ii).ElementAt (4).Right (5)>=strdate1 && m_List1array.ElementAt (ii).ElementAt (4).Right (5)<=strdate2)
  1278. {
  1279. if(bAdded==0)
  1280. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1281. if(m_radio1==0)
  1282. {
  1283. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1284. {
  1285. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1286. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1287. }
  1288. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1289. {
  1290. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1291. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1292. }
  1293. }
  1294. else if(m_radio1==1)
  1295. {
  1296. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1297. {
  1298. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1299. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1300. }
  1301. }
  1302. else if(m_radio1==2)
  1303. {
  1304. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1305. {
  1306. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1307. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1308. }
  1309. }
  1310. }
  1311. }
  1312. 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) )
  1313. {//结婚纪念,农历
  1314. if(m_List1array.ElementAt (ii).ElementAt (17).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (17).Right (5)<=strdate2nl)
  1315. {
  1316. if(bAdded==0)
  1317. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1318. if(m_radio1==0)
  1319. {
  1320. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1321. {
  1322. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1323. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1324. }
  1325. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1326. {
  1327. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1328. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1329. }
  1330. }
  1331. else if(m_radio1==1)
  1332. {
  1333. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1334. {
  1335. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1336. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1337. }
  1338. }
  1339. else if(m_radio1==2)
  1340. {
  1341. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1342. {
  1343. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1344. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1345. }
  1346. }
  1347. }
  1348. else if(m_List1array.ElementAt (ii).ElementAt (18).Right (5)>=strdate1nl && m_List1array.ElementAt (ii).ElementAt (18).Right (5)<=strdate2nl)
  1349. {
  1350. if(bAdded==0)
  1351. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1352. if(m_radio1==0)
  1353. {
  1354. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1355. {
  1356. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1357. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1358. }
  1359. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1360. {
  1361. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1362. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1363. }
  1364. }
  1365. else if(m_radio1==1)
  1366. {
  1367. if(!m_List1array.ElementAt (ii).ElementAt (3).IsEmpty ())
  1368. {
  1369. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (1));
  1370. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (3));
  1371. }
  1372. }
  1373. else if(m_radio1==2)
  1374. {
  1375. if(!m_List1array.ElementAt (ii).ElementAt (2).IsEmpty ())
  1376. {
  1377. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (0));
  1378. m_pArray->Add (m_List1array.ElementAt (ii).ElementAt (2));
  1379. }
  1380. }
  1381. }
  1382. }
  1383. }
  1384. }
  1385. m_List1.m_arLabels.SetSize(count, 1);
  1386. ii=count;
  1387. m_List1.m_LabelCount=ii;
  1388. m_List1.SetItemCountEx (ii);
  1389. #endif
  1390. }
  1391. void GetPhone::OnButton1()
  1392. {
  1393. // TODO: Add your control notification handler code here
  1394. FillGrid(0);
  1395. }
  1396. void GetPhone::OnButton2()
  1397. {
  1398. // TODO: Add your control notification handler code here
  1399. FillGrid(1);
  1400. }
  1401. void GetPhone::OnButton3()
  1402. {
  1403. // TODO: Add your control notification handler code here
  1404. FillGrid(2);
  1405. }
  1406. void GetPhone::OnButton4()
  1407. {
  1408. // TODO: Add your control notification handler code here
  1409. FillGrid(3);
  1410. }
  1411. void GetPhone::OnRadio1()
  1412. {
  1413. // TODO: Add your control notification handler code here
  1414. FillGrid(m_oldmode);
  1415. }
  1416. void GetPhone::OnRadio2()
  1417. {
  1418. // TODO: Add your control notification handler code here
  1419. FillGrid(m_oldmode);
  1420. }
  1421. void GetPhone::OnRadio3()
  1422. {
  1423. // TODO: Add your control notification handler code here
  1424. FillGrid(m_oldmode);
  1425. }
  1426. void GetPhone::OnCloseupCombo2()
  1427. {
  1428. // TODO: Add your control notification handler code here
  1429. FillGrid(m_oldmode);
  1430. }
  1431. void GetPhone::OnCloseupCombo3()
  1432. {
  1433. // TODO: Add your control notification handler code here
  1434. FillGrid(m_oldmode);
  1435. }
  1436. void GetPhone::OnCloseupCombo1()
  1437. {
  1438. // TODO: Add your control notification handler code here
  1439. if(m_oldmode)
  1440. FillGrid(m_oldmode);
  1441. }