GetPhone.cpp 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500
  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. }