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