GetPhone.cpp 46 KB

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