HospitalClient.cpp 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243
  1. // HospitalClient.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "HospitalClient.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "InputPsw.h"
  9. #include "ImportPhoto.h"
  10. #include "TakeMoney2.h"
  11. #include "ImportPhoto.h"
  12. #include "NeroDlg.h"
  13. #include "ClientRequirement.h"
  14. #include "ChoosePhotoSkin2.h"
  15. #include "./helper/ffsco.h"
  16. #include "AddHospitalClient.h"
  17. #include "SendMsgDlg.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. #pragma comment(lib, "Shlwapi.lib")
  24. /////////////////////////////////////////////////////////////////////////////
  25. // HospitalClient
  26. IMPLEMENT_DYNCREATE(HospitalClient, MyFormView)
  27. HospitalClient::HospitalClient()
  28. : MyFormView(HospitalClient::IDD)
  29. {
  30. m_datetype = 0;
  31. m_date2 = GetTmFromStr(g_date);
  32. m_date1 = m_date2-CTimeSpan(30, 0, 0, 0);
  33. m_addr = _T("");
  34. m_phone = _T("");
  35. m_bSearchAll=0;
  36. m_id = _T("");
  37. m_name = _T("");
  38. //}}AFX_DATA_INIT
  39. }
  40. HospitalClient::~HospitalClient()
  41. {
  42. }
  43. void HospitalClient::DoDataExchange(CDataExchange* pDX)
  44. {
  45. MyFormView::DoDataExchange(pDX);
  46. //{{AFX_DATA_MAP(HospitalClient)
  47. DDX_Control(pDX, IDC_COMBOclerk, clerkCombo);
  48. DDX_Control(pDX, IDC_COMBOtype, typeCombo);
  49. DDX_Control(pDX, IDC_COMBOfrom, fromCombo);
  50. DDX_Control(pDX, IDC_COMBOhospital, hospitalCombo);
  51. DDX_Control(pDX, IDC_COMBObusinessintention, businessintentionCombo);
  52. DDX_Control(pDX, IDC_COMBObusinesstype, businesstypeCombo);
  53. DDX_Control(pDX, IDC_LIST2, m_List1);
  54. DDX_Control(pDX, IDC_STATIC1, m_static1);
  55. DDX_Radio(pDX, IDC_RADIO1, m_datetype);
  56. DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKERdate1, m_date1);
  57. DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKERdate2, m_date2);
  58. DDX_Text(pDX, IDC_EDITaddr1, m_addr);
  59. DDX_Text(pDX, IDC_EDITphone1, m_phone);
  60. DDX_Text(pDX, IDC_EDITid, m_id);
  61. DDX_Text(pDX, IDC_EDITname, m_name);
  62. //}}AFX_DATA_MAP
  63. }
  64. BEGIN_MESSAGE_MAP(HospitalClient, MyFormView)
  65. //{{AFX_MSG_MAP(HospitalClient)
  66. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  67. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  68. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  69. ON_WM_TIMER()
  70. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  71. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  72. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  73. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  74. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  75. ON_BN_CLICKED(IDC_BUTburncd, OnBUTHospitalClient)
  76. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  77. ON_BN_CLICKED(IDC_BUTburncd2, OnBUTburncd2)
  78. ON_BN_CLICKED(IDC_BUTburncd3, OnBUTburncd3)
  79. ON_BN_CLICKED(IDC_BUTsendmsg, OnBUTsendmsg)
  80. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  81. //}}AFX_MSG_MAP
  82. END_MESSAGE_MAP()
  83. /////////////////////////////////////////////////////////////////////////////
  84. // HospitalClient diagnostics
  85. #ifdef _DEBUG
  86. void HospitalClient::AssertValid() const
  87. {
  88. MyFormView::AssertValid();
  89. }
  90. void HospitalClient::Dump(CDumpContext& dc) const
  91. {
  92. MyFormView::Dump(dc);
  93. }
  94. #endif //_DEBUG
  95. /////////////////////////////////////////////////////////////////////////////
  96. // HospitalClient message handlers
  97. void HospitalClient::OnInitialUpdate()
  98. {
  99. //AfxMessageBox("意向查询");//Jeff
  100. MyFormView::OnInitialUpdate();
  101. // GetDlgItem(IDC_BUTburncd)->EnableWindow(IsHasRights2new(0));
  102. // GetDlgItem(IDC_BUTburncd2)->EnableWindow(IsHasRights2new(0));
  103. GetDlgItem(IDC_BUTburncd3)->EnableWindow(IsHasRights2new(49));
  104. GetDlgItem(IDC_BUTprint3)->EnableWindow(IsHasRights2new(49));
  105. // TODO: Add your specialized code here and/or call the base class
  106. CMyMdi Mdi;
  107. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  108. // Here we create the outbar control using the splitter as its parent
  109. // and setting its id to the first pane.
  110. CRect rc2;
  111. GetWindowRect(rc2);
  112. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  113. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
  114. int idarray[]={IDC_BUTburncd,IDC_BUTburncd2,IDC_BUTburncd3,IDC_BUTsendmsg,IDC_BUTprint3,IDC_BUTclose};
  115. int idcount=6;
  116. int btnwid;
  117. CRect prerc;
  118. for(int a=idcount-2; a>=0; a--)
  119. {
  120. GetDlgItem(idarray[a+1])->GetWindowRect (prerc);
  121. ScreenToClient(prerc);
  122. GetDlgItem(idarray[a])->GetWindowRect (rc2);
  123. ScreenToClient(rc2);
  124. btnwid=rc2.Width ();
  125. rc2.right =prerc.left ;
  126. rc2.left =rc2.right -btnwid;
  127. GetDlgItem(idarray[a])->MoveWindow (rc2);
  128. }
  129. m_static1.SetFont (&g_titlefont);
  130. #if 0 // Jeff 2014.05.19
  131. m_List1.SetHeadings("来单批号,100;客户姓名,100;宝宝姓名,100;宝宝性别,100;区域,100;类别,100;医院,100;电话1,100;电话2,100;QQ,100;地址1,100;地址2,100;地址3,100;录入日期,100;门市,100;录入员,100;业务种类,100;业务意向,100;预约日期,100;上门地址,100;备注,100" );
  132. #else
  133. m_List1.SetHeadings("来单批号,100;客户姓名,100;宝宝姓名,100;宝宝性别,100;生日类型,100;宝宝生日,100;区域,100;类别,100;医院,100;电话1,100;电话2,100;QQ,100;地址1,100;地址2,100;地址3,100;录入日期,100;门市,100;录入员,100;业务种类,100;业务意向,100;预约日期,100;上门地址,100;备注,100" );
  134. #endif
  135. m_List1.LoadColumnInfo (144);
  136. m_List1.m_bSortSupport=0;
  137. g_sendhead.bsql=0;
  138. g_sendhead.code[0]=200;
  139. g_sendhead.code[1]=201;
  140. g_sendhead.code[2]=202;
  141. g_sendhead.code[3]=203;
  142. g_sendhead.code[4]=82;
  143. g_sendhead.tabcount=5;
  144. //LOG4C((LOG_NOTICE,"ProcessChatMessageRequest2=3"));
  145. g_pMainWnd->ProcessChatMessageRequest2(3);
  146. if(g_bSendOK)
  147. {
  148. CArray<CStringArray, CStringArray>List1array;
  149. CArray<CStringArray, CStringArray>List2array;
  150. CArray<CStringArray, CStringArray>List3array;
  151. CArray<CStringArray, CStringArray>List4array;
  152. CArray<CStringArray, CStringArray>List5array;
  153. DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array);
  154. for(int ii=0; ii<List1array.GetSize (); ii++)
  155. businesstypeCombo.AddString ( List1array.ElementAt (ii).ElementAt(0) );
  156. for( ii=0; ii<List2array.GetSize (); ii++)
  157. businessintentionCombo.AddString ( List2array.ElementAt (ii).ElementAt(0) );
  158. for( ii=0; ii<List3array.GetSize (); ii++)
  159. typeCombo.AddString ( List3array.ElementAt (ii).ElementAt(0) );
  160. for( ii=0; ii<List4array.GetSize (); ii++)
  161. hospitalCombo.AddString ( List4array.ElementAt (ii).ElementAt(0) );
  162. for( ii=0; ii<List5array.GetSize (); ii++)
  163. fromCombo.AddString ( List5array.ElementAt (ii).ElementAt(0) );
  164. businesstypeCombo.AddString("");
  165. businessintentionCombo.AddString("");
  166. typeCombo.AddString("");
  167. hospitalCombo.AddString("");
  168. fromCombo.AddString("");
  169. }
  170. GetData();
  171. /* m_combo1.GetWindowRect (rc2);
  172. ScreenToClient(rc2);
  173. rc2.bottom +=200;
  174. m_combo1.MoveWindow (rc2);
  175. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  176. SetComboHei(&m_combo1, rc2.Height ());*/
  177. }
  178. void HospitalClient::OnBUTclose()
  179. {
  180. // TODO: Add your control notification handler code here
  181. GetParent()->SendMessage(WM_CLOSE);
  182. }
  183. void HospitalClient::OnSelchangeCombo1()
  184. {
  185. // TODO: Add your control notification handler code here
  186. SetTimer(1, 100, NULL);
  187. }
  188. void HospitalClient::OnTimer(UINT nIDEvent)
  189. {
  190. // TODO: Add your message handler code here and/or call default
  191. KillTimer(nIDEvent);
  192. OnButton1();
  193. }
  194. BOOL HospitalClient::PreTranslateMessage(MSG* pMsg)
  195. {
  196. // TODO: Add your specialized code here and/or call the base class
  197. try
  198. {
  199. if(pMsg->message==WM_KEYDOWN)
  200. {
  201. switch (pMsg->wParam)
  202. {
  203. case VK_RETURN:
  204. OnButton1();
  205. return 1;
  206. case 0x43: // copy
  207. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  208. {
  209. GetFocus()->SendMessage(WM_COPY);
  210. return TRUE;
  211. }
  212. break;
  213. case 0x56: //Ctrl + V:
  214. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  215. {
  216. GetFocus()->SendMessage(WM_PASTE);
  217. return TRUE;
  218. }
  219. break;
  220. case 0x58: // cut
  221. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  222. {
  223. GetFocus()->SendMessage(WM_CUT);
  224. return TRUE;
  225. }
  226. break;
  227. case 0x5A: //undo
  228. case 0x59: //redo
  229. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  230. {
  231. GetFocus()->SendMessage(WM_UNDO);
  232. return TRUE;
  233. }
  234. break;
  235. }
  236. }
  237. return MyFormView::PreTranslateMessage(pMsg);
  238. }
  239. catch(...)
  240. {
  241. }
  242. }
  243. extern int CALLBACK BrowseProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData);
  244. /*{
  245. switch(msg)
  246. {
  247. case BFFM_INITIALIZED:
  248. SendMessage(hwnd, BFFM_SETSELECTION, TRUE, NULL);
  249. break;
  250. case BFFM_SELCHANGED:
  251. {
  252. char szFileName[MAX_PATH];
  253. LPITEMIDLIST pidlCurrent = (LPITEMIDLIST)lParam;
  254. SHGetPathFromIDList(pidlCurrent, szFileName);
  255. SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szFileName);
  256. }
  257. break;
  258. }
  259. return 0;
  260. }*/
  261. void HospitalClient::GetSavePath(CString &path)
  262. {
  263. char lpszDisplayName[MAX_PATH], szFileName[MAX_PATH];
  264. LPITEMIDLIST pidlDesktop, pidlCurrent;
  265. if(SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop)
  266. == NOERROR)
  267. {
  268. BROWSEINFO bi;
  269. bi.hwndOwner = this->m_hWnd;
  270. bi.pidlRoot = pidlDesktop;
  271. bi.pszDisplayName = lpszDisplayName;
  272. bi.lpszTitle = "\n文档保存的目录:";
  273. bi.ulFlags = BIF_STATUSTEXT&BIF_RETURNONLYFSDIRS ;
  274. bi.lpfn = BrowseProc;
  275. bi.lParam = 0;
  276. bi.iImage = 0;
  277. pidlCurrent = SHBrowseForFolder(&bi);
  278. SHGetPathFromIDList(pidlCurrent, szFileName);
  279. path = szFileName;
  280. }
  281. }
  282. int HospitalClient::FindArray(CStringArray *pArray, CString Str)
  283. {
  284. for(int i=0; i<pArray->GetSize (); i++)
  285. {
  286. if(pArray->ElementAt (i)==Str)
  287. return i;
  288. }
  289. return -1;
  290. }
  291. void HospitalClient::GetNo(CString str, CStringArray &array)
  292. {
  293. if(!str.IsEmpty ())
  294. {
  295. int pos=str.Find (",");
  296. while(pos!=-1)
  297. {
  298. if(FindArray(&array, str.Left (pos))==-1)
  299. array.Add (str.Left (pos));
  300. str=str.Right (str.GetLength ()-pos-1);
  301. pos=str.Find (",");
  302. }
  303. if(FindArray(&array, str)==-1)
  304. array.Add(str);
  305. }
  306. }
  307. CString HospitalClient::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  308. {
  309. CString ret;
  310. name=","+name+",";
  311. CString str;
  312. for(int i=0; i<spnamearray.GetSize (); i++)
  313. {
  314. str=","+spnamearray.ElementAt (i).ElementAt (6)+",";
  315. if(str.Find (name)!=-1)
  316. {
  317. ret+=spnamearray.ElementAt (i).ElementAt (5);
  318. ret+=";";
  319. }
  320. }
  321. ret.TrimRight (";");
  322. ret.Replace ("*", "x");
  323. return ret;
  324. }
  325. void HospitalClient::OnBUTexportphoto()
  326. {
  327. /* if(IsHasRights2new(11)==0)return;
  328. // TODO: Add your control notification handler code here
  329. POSITION pos;
  330. pos=m_List1.GetFirstSelectedItemPosition();
  331. if(pos==NULL)
  332. {
  333. AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
  334. return;
  335. }
  336. int iItem=m_List1.GetNextSelectedItem(pos);
  337. CString id=m_List1.GetItemText (iItem, 0);
  338. CString path;
  339. path=g_path4+"\\";
  340. path+=id;
  341. path +="\\";
  342. CString temp;
  343. CStringArray array;
  344. using namespace helper_coffs;
  345. ffsco o;
  346. o.dirs(0);
  347. o.find(LPCSTR(path), LPCSTR("*.jpg"));
  348. ffsco::typeT coo;
  349. ffsco::typeT::iterator it;
  350. coo = o.co_file();
  351. for (it = coo.begin();
  352. coo.end() != it;
  353. it ++)
  354. {
  355. temp=(*it).c_str();
  356. if(temp.GetAt (temp.ReverseFind ('\\')+1)!='s')
  357. {
  358. array.Add (temp);
  359. }
  360. }
  361. if(array.GetSize ()==0)
  362. {
  363. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  364. return;
  365. }
  366. CString dir;
  367. GetSavePath(dir);
  368. if(dir.IsEmpty())
  369. {
  370. return;
  371. }
  372. CString name1=m_List1.GetItemText (iItem, 1);
  373. CString name2=m_List1.GetItemText (iItem, 2);
  374. dir.TrimRight ('\\');
  375. dir+="\\";
  376. dir+=id;
  377. dir+=name1;
  378. dir+=name2;
  379. dir+="精修好的片";
  380. dir+="\\";
  381. ::CreateDirectory (dir, NULL);
  382. ImportPhoto dlg;
  383. dlg.m_mode =1;
  384. dlg.m_pArray=&array;
  385. dlg.m_savepath =dir;
  386. dlg.DoModal (); AfxMessageBox("导片成功!", MB_ICONINFORMATION); */
  387. }
  388. void HospitalClient::OnBUTimportphoto()
  389. {
  390. // TODO: Add your control notification handler code here
  391. POSITION pos;
  392. pos=m_List1.GetFirstSelectedItemPosition();
  393. if(pos==NULL)
  394. {
  395. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  396. return;
  397. }
  398. int iItem=m_List1.GetNextSelectedItem(pos);
  399. CString id=m_List1.GetItemText (iItem, 0);
  400. CString oldstatus=m_List1.GetItemText (iItem, 4);
  401. CString name=m_List1.GetItemText (iItem, 1)+","+m_List1.GetItemText (iItem, 2);
  402. name.TrimLeft (",");
  403. name.TrimRight (",");
  404. name="客人:"+name;
  405. CString phone=m_List1.GetItemText (iItem, 13)+","+m_List1.GetItemText (iItem, 14);
  406. phone.TrimLeft (",");
  407. phone.TrimRight (",");
  408. phone="电话:"+phone;
  409. if(g_path3.IsEmpty ())
  410. {
  411. AfxMessageBox("未设置设计片保存机器, 请通知系统管理员!", MB_ICONINFORMATION);
  412. return;
  413. }
  414. if(!::CheckFolderFileExist (g_path3))
  415. {
  416. AfxMessageBox("设计片保存机器目录未设置, 请通知系统管理员!", MB_ICONINFORMATION);
  417. return;
  418. }
  419. CString savepath=g_path3+"\\";
  420. savepath+=id+"\\";
  421. if(::CheckFolderFileExist (savepath)==0)
  422. ::CreateDirectory (savepath, NULL);
  423. CString srcdir;CString str;
  424. GetSavePath(srcdir);
  425. if(srcdir.IsEmpty())
  426. {
  427. CString status5;
  428. if(AfxMessageBox("客照是否全部设计完毕?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  429. status5="OK";
  430. else
  431. status5="设计中";
  432. CString sql;
  433. sql="update dindan set status5='"+status5+"' where id='"+id+"'";
  434. sql+=DINDAN_REF;
  435. g_sendhead.bsql=1;
  436. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  437. for(int i=0; i<m_List1array.GetSize (); i++)
  438. {
  439. if(id==m_List1array.ElementAt (i).ElementAt (0))
  440. {
  441. m_List1array.ElementAt (i).SetAt (4, status5);
  442. FillGrid();
  443. break;
  444. }
  445. }
  446. return;
  447. }
  448. if(srcdir.GetLength ()<4)
  449. {
  450. AfxMessageBox("请选择正确的您文件所在的目录!", MB_ICONSTOP);
  451. return;
  452. }
  453. if(oldstatus!="未设计")
  454. {
  455. CString str;
  456. str.Format ("%s\r\n%s\r\n此单已导入过设计片, 确认您选中的照片没有导入过吗? 否则会覆盖原来的照片, 是否继续?", name, phone );
  457. if(AfxMessageBox(str, MB_YESNO|MB_ICONSTOP)!=IDYES)
  458. return;
  459. }
  460. else
  461. {
  462. CString str;
  463. str.Format ("%s\r\n%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone );
  464. if(AfxMessageBox(str, MB_YESNO|MB_ICONINFORMATION)!=IDYES)
  465. return;
  466. }
  467. CStringArray array;
  468. CStringArray desarray;
  469. CStringArray dirarray;
  470. if(1)
  471. {
  472. using namespace helper_coffs;
  473. ffsco o;
  474. o.dirs(1);
  475. o.find(LPCSTR(srcdir), LPCSTR("*.*"));
  476. ffsco::typeT coo;
  477. ffsco::typeT::iterator it;
  478. coo = o.co_dir();
  479. for (it = coo.begin();
  480. coo.end() != it;
  481. it ++)
  482. {
  483. str=(*it).c_str();
  484. if(FindArray(&dirarray, str)==-1)
  485. {
  486. dirarray.Add (str);
  487. if(str!=dirarray.ElementAt (0))
  488. {
  489. str=savepath+str.Right (str.GetLength ()-dirarray.ElementAt (0).GetLength ());
  490. if(::CheckFolderFileExist (str)==0)
  491. ::CreateDirectory (str, NULL);
  492. }
  493. }
  494. }
  495. }
  496. if(1)
  497. {
  498. for(int i=0; i<dirarray.GetSize (); i++)
  499. {
  500. using namespace helper_coffs;
  501. ffsco o;
  502. o.dirs(0);
  503. o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
  504. ffsco::typeT coo;
  505. ffsco::typeT::iterator it;
  506. coo = o.co_file();
  507. for (it = coo.begin();
  508. coo.end() != it;
  509. it ++)
  510. {
  511. str=(*it).c_str();
  512. array.Add (str);
  513. desarray.Add (savepath+dirarray.ElementAt (i).Right (dirarray.ElementAt (i).GetLength ()-dirarray.ElementAt (0).GetLength ())+str.Right (str.GetLength ()-str.ReverseFind ('\\')-1));
  514. }
  515. }
  516. }
  517. if(array.GetSize ()==0)return;
  518. ImportPhoto dlg;
  519. dlg.m_pArray=&array;
  520. dlg.m_pDesArray=&desarray;
  521. dlg.m_savepath =savepath;
  522. dlg.DoModal ();
  523. CString status5;
  524. if(AfxMessageBox("客照是否全部设计完毕?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  525. status5="OK";
  526. else
  527. status5="设计中";
  528. CString sql;
  529. sql="update dindan set status5='"+status5+"',waiter4='"+g_user.name+"' where id='"+id+"'";
  530. sql+=DINDAN_REF;
  531. g_sendhead.bsql=1;
  532. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  533. savepath+="ok";
  534. ::DeleteFile (savepath);
  535. AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
  536. for(int i=0; i<m_List1array.GetSize (); i++)
  537. {
  538. if(id==m_List1array.ElementAt (i).ElementAt (0))
  539. {
  540. m_List1array.ElementAt (i).SetAt (4, status5);
  541. m_List1array.ElementAt (i).SetAt (10, g_user.name);
  542. FillGrid();
  543. break;
  544. }
  545. }
  546. }
  547. void HospitalClient::OnBUTshowphoto()
  548. {
  549. // TODO: Add your control notification handler code here
  550. POSITION pos;
  551. pos=m_List1.GetFirstSelectedItemPosition();
  552. if(pos==NULL)
  553. {
  554. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  555. return;
  556. }
  557. int iItem=m_List1.GetNextSelectedItem(pos);
  558. CString status=m_List1.GetItemText (iItem, 4);
  559. CString id=m_List1.GetItemText (iItem, 0);
  560. if(status=="未设计")
  561. {
  562. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  563. return;
  564. }
  565. /* ShowPic dlg;
  566. dlg.m_path=g_path3+"\\";
  567. dlg.m_path+=id;
  568. dlg.m_path +="\\";
  569. dlg.DoModal ();*/
  570. ChoosePhotoSkin2 dlg;
  571. dlg.m_mode2 =1;
  572. dlg.SetLiaPath ("3.lia");
  573. dlg.m_strOrderNumber=id;
  574. dlg.m_path=g_path3+"\\";
  575. dlg.m_path+=id;
  576. dlg.m_path +="\\";
  577. dlg.DoModal ();
  578. for(int i=0; i<m_List1array.GetSize (); i++)
  579. {
  580. if(id==m_List1array.ElementAt (i).ElementAt (0))
  581. {
  582. m_List1array.ElementAt (i).SetAt (7, dlg.m_bz2);
  583. // FillGrid();
  584. break;
  585. }
  586. }
  587. }
  588. // Jeff 2014.05.20:开始查询按钮;
  589. void HospitalClient::OnButton1()
  590. {
  591. // TODO: Add your control notification handler code here
  592. m_bSearchAll=0;
  593. FillGrid();
  594. }
  595. // 全部查询按钮;
  596. void HospitalClient::OnButton2()
  597. {
  598. // TODO: Add your control notification handler code here
  599. m_bSearchAll=1;
  600. FillGrid();
  601. }
  602. void HospitalClient::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  603. {
  604. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  605. // TODO: Add your control notification handler code here
  606. *pResult = 0;
  607. }
  608. void HospitalClient::OnBUTHospitalClient()
  609. {
  610. // TODO: Add your control notification handler code here
  611. AddHospitalClient dlg;
  612. dlg.DoModal();
  613. GetData();
  614. }
  615. void HospitalClient::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  616. {
  617. // TODO: Add your control notification handler code here
  618. POSITION pos;
  619. pos=m_List1.GetFirstSelectedItemPosition();
  620. if(pos==NULL)return;
  621. OnBUTburncd2();
  622. *pResult = 0;
  623. }
  624. void HospitalClient::OnBUTburncd2()
  625. {
  626. // TODO: Add your control notification handler code here
  627. POSITION pos;
  628. pos=m_List1.GetFirstSelectedItemPosition();
  629. if(pos==NULL)
  630. {
  631. AfxMessageBox("请先选中您要修改的客户!", MB_ICONINFORMATION);
  632. return;
  633. }
  634. int iItem=m_List1.GetNextSelectedItem(pos);
  635. CString id=m_List1.GetItemText (iItem, 0);
  636. while(id=="")
  637. {
  638. iItem--;
  639. id=m_List1.GetItemText (iItem, 0);
  640. }
  641. AddHospitalClient dlg;
  642. dlg.bAdd =0;
  643. dlg.no=id;
  644. dlg.DoModal();
  645. GetData();
  646. }
  647. void HospitalClient::OnBUTburncd3()
  648. {
  649. // TODO: Add your control notification handler code here
  650. POSITION pos;
  651. pos=m_List1.GetFirstSelectedItemPosition();
  652. if(pos==NULL)
  653. {
  654. AfxMessageBox("请先选中您要删除的客户!", MB_ICONINFORMATION);
  655. return;
  656. }
  657. int iItem=m_List1.GetNextSelectedItem(pos);
  658. CString id=m_List1.GetItemText (iItem, 0);
  659. while(id=="")
  660. {
  661. iItem--;
  662. id=m_List1.GetItemText (iItem, 0);
  663. }
  664. if(AfxMessageBox("确认删除吗?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  665. CString sql;
  666. sql.Format ("delete from hospitalclient where id='%s'***delete from hospitalclientcontactreg where id='%s'", id, id);
  667. g_sendhead.bsql=1;
  668. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  669. GetData();
  670. }
  671. void HospitalClient::OnBUTsendmsg()
  672. {
  673. // TODO: Add your control notification handler code here
  674. POSITION pos;
  675. pos=m_List1.GetFirstSelectedItemPosition();
  676. if(pos==NULL)
  677. {
  678. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  679. return;
  680. }
  681. int iItem;
  682. CStringArray array;
  683. while (pos)
  684. {
  685. iItem = m_List1.GetNextSelectedItem(pos);
  686. if(!m_List1.GetItemText (iItem, 7).IsEmpty ())
  687. array.Add (m_List1.GetItemText (iItem, 7));
  688. if(!m_List1.GetItemText (iItem, 8).IsEmpty ())
  689. array.Add (m_List1.GetItemText (iItem, 8));
  690. }
  691. SendMsgDlg dlg;
  692. dlg.m_mode=2;
  693. dlg.m_pArray=&array;
  694. dlg.DoModal ();
  695. }
  696. void HospitalClient::OnBUTprint3()
  697. {
  698. ListToXLS(&m_List1, "c:\\意向单列表.xls", 0);
  699. }
  700. // 获取数据
  701. void HospitalClient::GetData()
  702. {
  703. g_sendhead.bsql=0;
  704. g_sendhead.code[0]=205;
  705. g_sendhead.tabcount=1;
  706. g_pMainWnd->ProcessChatMessageRequest2(1);
  707. if(g_bSendOK==0)
  708. return;
  709. DataToArray(&m_List1array);
  710. if(m_List1array.GetSize ())
  711. {
  712. CString id=m_List1array.ElementAt (0).ElementAt (0);
  713. for(int ii=1; ii<m_List1array.GetSize(); ii++)
  714. {
  715. if(m_List1array.ElementAt (ii).ElementAt(0)==id)
  716. {
  717. m_List1array.ElementAt (ii).SetAt (0, "");
  718. m_List1array.ElementAt (ii).SetAt (1, "");
  719. m_List1array.ElementAt (ii).SetAt (2, "");
  720. m_List1array.ElementAt (ii).SetAt (3, "");
  721. m_List1array.ElementAt (ii).SetAt (4, "");
  722. m_List1array.ElementAt (ii).SetAt (5, "");
  723. m_List1array.ElementAt (ii).SetAt (6, "");
  724. m_List1array.ElementAt (ii).SetAt (7, "");
  725. m_List1array.ElementAt (ii).SetAt (8, "");
  726. m_List1array.ElementAt (ii).SetAt (9, "");
  727. m_List1array.ElementAt (ii).SetAt (10, "");
  728. m_List1array.ElementAt (ii).SetAt (11, "");
  729. m_List1array.ElementAt (ii).SetAt (12, "");
  730. m_List1array.ElementAt (ii).SetAt (13, "");
  731. m_List1array.ElementAt (ii).SetAt (14, "");
  732. m_List1array.ElementAt (ii).SetAt (15, "");
  733. m_List1array.ElementAt (ii).SetAt (21, "");
  734. m_List1array.ElementAt (ii).SetAt (22, "");
  735. m_List1array.ElementAt (ii).SetAt (23, ""); // Jeff Add 20014.05.20
  736. m_List1array.ElementAt (ii).SetAt (24, ""); // Jeff Add 20014.05.20
  737. }
  738. else
  739. id=m_List1array.ElementAt (ii).ElementAt (0);
  740. }
  741. }
  742. FillGrid();
  743. }
  744. void HospitalClient::FillGrid()
  745. {
  746. UpdateData();
  747. m_List1.DeleteAllItems2 ();
  748. int ii=0;
  749. int maxsize=m_List1array.GetSize ();
  750. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  751. CArray<int,int>signarray;
  752. for(int i=0; i<maxsize; i++)
  753. signarray.Add(1);
  754. int count=0;
  755. CArray<int,int>posarray;
  756. if(m_bSearchAll) // 查询全部hostpitalview的记录;
  757. {
  758. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  759. {
  760. #if 0 // Jeff;
  761. // LOG4C((LOG_NOTICE,"生日类型:%s",m_List1array.ElementAt(ii).ElementAt(4)));
  762. if ( m_List1array.ElementAt(ii).ElementAt(4) == "0")
  763. m_List1array.ElementAt(ii).SetAt(4,"宝宝生日");
  764. else
  765. m_List1array.ElementAt(ii).SetAt(4,"预产期");
  766. #endif
  767. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  768. }
  769. }
  770. else
  771. {
  772. CString date1=m_date1.Format("%Y-%m-%d");
  773. CString date2=m_date2.Format("%Y-%m-%d");
  774. CString type,hospital,from,clerk,businesstype,businessintention;
  775. int pos=typeCombo.GetCurSel ();
  776. if(pos!=-1)
  777. {
  778. typeCombo.GetLBText (pos, type);
  779. }
  780. pos=hospitalCombo.GetCurSel ();
  781. if(pos!=-1)
  782. {
  783. hospitalCombo.GetLBText (pos, hospital);
  784. }
  785. pos=fromCombo.GetCurSel ();
  786. if(pos!=-1)
  787. {
  788. fromCombo.GetLBText (pos, from);
  789. }
  790. pos=clerkCombo.GetCurSel ();
  791. if(pos!=-1)
  792. {
  793. clerkCombo.GetLBText (pos, clerk);
  794. }
  795. pos=businesstypeCombo.GetCurSel ();
  796. if(pos!=-1)
  797. {
  798. businesstypeCombo.GetLBText (pos, businesstype);
  799. }
  800. pos=businessintentionCombo.GetCurSel ();
  801. if(pos!=-1)
  802. {
  803. businessintentionCombo.GetLBText (pos, businessintention);
  804. }
  805. if(m_datetype)
  806. {
  807. BOOL bFinded=0;
  808. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  809. {
  810. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  811. {
  812. continue;
  813. }
  814. //if(m_List1array.ElementAt (ii).ElementAt (13)<date1 || m_List1array.ElementAt (ii).ElementAt (13)>date2)//Jeff:hostpitalview加了两个字段,这里不是13
  815. if(m_List1array.ElementAt (ii).ElementAt (15)<date1 || m_List1array.ElementAt (ii).ElementAt (15)>date2)
  816. {
  817. signarray.SetAt(ii, 0);
  818. bFinded=0;
  819. continue;
  820. }
  821. bFinded=1;
  822. }
  823. }
  824. if(from!="")
  825. {
  826. BOOL bFinded=0;
  827. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  828. {
  829. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  830. {
  831. continue;
  832. }
  833. //if(m_List1array.ElementAt (ii).ElementAt (4)!=from)////Jeff:hostpitalview加了两个字段,这里不为4
  834. if(m_List1array.ElementAt (ii).ElementAt (6)!=from)
  835. {
  836. signarray.SetAt(ii, 0);
  837. bFinded=0;
  838. continue;
  839. }
  840. bFinded=1;
  841. }
  842. }
  843. if(type!="")
  844. {
  845. BOOL bFinded=0;
  846. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  847. {
  848. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  849. {
  850. continue;
  851. }
  852. //if(m_List1array.ElementAt (ii).ElementAt (5)!=type)//Jeff:hostpitalview加了两个字段,这里不为5
  853. if(m_List1array.ElementAt (ii).ElementAt (7)!=type)
  854. {
  855. signarray.SetAt(ii, 0);
  856. bFinded=0;
  857. continue;
  858. }
  859. bFinded=1;
  860. }
  861. }
  862. if(hospital!="")
  863. {
  864. BOOL bFinded=0;
  865. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  866. {
  867. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  868. {
  869. continue;
  870. }
  871. //if(m_List1array.ElementAt (ii).ElementAt (6)!=hospital)//Jeff:hostpitalview加了两个字段,这里不为6
  872. if(m_List1array.ElementAt (ii).ElementAt (8)!=hospital)
  873. {
  874. signarray.SetAt(ii, 0);
  875. bFinded=0;
  876. continue;
  877. }
  878. bFinded=1;
  879. }
  880. }
  881. if(clerk!="")
  882. {
  883. BOOL bFinded=0;
  884. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  885. {
  886. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  887. {
  888. continue;
  889. }
  890. //if(m_List1array.ElementAt (ii).ElementAt (14)!=clerk)//Jeff:hostpitalview加了两个字段,这里不为14
  891. if(m_List1array.ElementAt (ii).ElementAt (16)!=clerk)//
  892. {
  893. signarray.SetAt(ii, 0);
  894. bFinded=0;
  895. continue;
  896. }
  897. bFinded=1;
  898. }
  899. }
  900. if(m_phone!="")
  901. {
  902. BOOL bFinded=0;
  903. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  904. {
  905. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  906. {
  907. continue;
  908. }
  909. //Jeff:hostpitalview加了两个字段,这里不为7/8
  910. //if(m_List1array.ElementAt (ii).ElementAt (7).Find(m_phone)==-1 && m_List1array.ElementAt (ii).ElementAt (8).Find(m_phone)==-1)
  911. if(m_List1array.ElementAt (ii).ElementAt (9).Find(m_phone)==-1 && m_List1array.ElementAt (ii).ElementAt (10).Find(m_phone)==-1)
  912. {
  913. signarray.SetAt(ii, 0);
  914. bFinded=0;
  915. continue;
  916. }
  917. bFinded=1;
  918. }
  919. }
  920. if(m_addr!="")
  921. {
  922. BOOL bFinded=0;
  923. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  924. {
  925. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  926. {
  927. continue;
  928. }
  929. //Jeff:hostpitalview加了两个字段,这里不为10/11/12
  930. //if(m_List1array.ElementAt (ii).ElementAt (10).Find(m_addr)==-1 && m_List1array.ElementAt (ii).ElementAt (11).Find(m_addr)==-1 && m_List1array.ElementAt (ii).ElementAt (12).Find(m_addr)==-1)
  931. if(m_List1array.ElementAt (ii).ElementAt (12).Find(m_addr)==-1 && m_List1array.ElementAt (ii).ElementAt (13).Find(m_addr)==-1 && m_List1array.ElementAt (ii).ElementAt (14).Find(m_addr)==-1)
  932. {
  933. signarray.SetAt(ii, 0);
  934. bFinded=0;
  935. continue;
  936. }
  937. bFinded=1;
  938. }
  939. }
  940. if(m_id!="")
  941. {
  942. BOOL bFinded=0;
  943. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  944. {
  945. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  946. {
  947. continue;
  948. }
  949. if(m_List1array.ElementAt (ii).ElementAt (0).Find(m_id)==-1 )
  950. {
  951. signarray.SetAt(ii, 0);
  952. bFinded=0;
  953. continue;
  954. }
  955. bFinded=1;
  956. }
  957. }
  958. if(m_name!="")
  959. {
  960. m_name.MakeUpper ();
  961. BOOL bFinded=0;
  962. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  963. {
  964. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  965. {
  966. continue;
  967. }
  968. //Jeff:hostpitalview加了两个字段,这里不为21/22
  969. //if(m_List1array.ElementAt (ii).ElementAt (1).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (2).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (21).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (22).Find(m_name)==-1)
  970. if(m_List1array.ElementAt (ii).ElementAt (1).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (2).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (23).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (24).Find(m_name)==-1)
  971. {
  972. signarray.SetAt(ii, 0);
  973. bFinded=0;
  974. continue;
  975. }
  976. bFinded=1;
  977. }
  978. }
  979. if(m_datetype==0)
  980. {
  981. BOOL bFinded=0;
  982. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  983. {
  984. if(0)//bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  985. {
  986. continue;
  987. }
  988. //Jeff:hostpitalview加了两个字段,这里不为18
  989. //if(m_List1array.ElementAt (ii).ElementAt (18)<date1 || m_List1array.ElementAt (ii).ElementAt (18)>date2)
  990. if(m_List1array.ElementAt (ii).ElementAt (20)<date1 || m_List1array.ElementAt (ii).ElementAt (20)>date2)
  991. {
  992. signarray.SetAt(ii, 0);
  993. bFinded=0;
  994. continue;
  995. }
  996. bFinded=1;
  997. }
  998. }
  999. if(businesstype!="")
  1000. {
  1001. BOOL bFinded=0;
  1002. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  1003. {
  1004. if(0)//bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  1005. {
  1006. continue;
  1007. }
  1008. //Jeff:hostpitalview加了两个字段,这里不为16
  1009. //if(m_List1array.ElementAt (ii).ElementAt (16)!=businesstype)
  1010. if(m_List1array.ElementAt (ii).ElementAt (18)!=businesstype)
  1011. {
  1012. signarray.SetAt(ii, 0);
  1013. bFinded=0;
  1014. continue;
  1015. }
  1016. bFinded=1;
  1017. }
  1018. }
  1019. if(businessintention!="")
  1020. {
  1021. BOOL bFinded=0;
  1022. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  1023. {
  1024. if(0)//bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  1025. {
  1026. continue;
  1027. }
  1028. //Jeff:hostpitalview加了两个字段,这里不为17
  1029. //if(m_List1array.ElementAt (ii).ElementAt (17)!=businessintention)
  1030. if(m_List1array.ElementAt (ii).ElementAt (19)!=businessintention)
  1031. {
  1032. signarray.SetAt(ii, 0);
  1033. bFinded=0;
  1034. continue;
  1035. }
  1036. bFinded=1;
  1037. }
  1038. }
  1039. for(ii=0; ii<signarray.GetSize (); ii++)
  1040. {
  1041. if(signarray.ElementAt(ii))
  1042. {
  1043. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  1044. posarray.Add(ii);
  1045. }
  1046. }
  1047. }
  1048. m_List1.m_arLabels.SetSize(count, 1);
  1049. if(m_bSearchAll==0)
  1050. {
  1051. for(int i=0; i<posarray.GetSize(); i++)
  1052. {
  1053. int pos=posarray.ElementAt (i);
  1054. CString id=m_List1array.ElementAt (pos).ElementAt(0);
  1055. while(id=="")
  1056. {
  1057. pos--;
  1058. id=m_List1array.ElementAt (pos).ElementAt(0);
  1059. }
  1060. posarray.SetAt(i, pos);
  1061. }
  1062. for( i=0; i<count; i++)
  1063. {
  1064. if(m_List1.m_arLabels.ElementAt(i).ElementAt(0)=="")
  1065. {
  1066. int pos=posarray.ElementAt (i);
  1067. m_List1.m_arLabels.ElementAt (i).SetAt (0, m_List1array.ElementAt (pos).ElementAt(0) );
  1068. m_List1.m_arLabels.ElementAt (i).SetAt (1, m_List1array.ElementAt (pos).ElementAt(1) );
  1069. m_List1.m_arLabels.ElementAt (i).SetAt (2, m_List1array.ElementAt (pos).ElementAt(2) );
  1070. m_List1.m_arLabels.ElementAt (i).SetAt (3, m_List1array.ElementAt (pos).ElementAt(3) );
  1071. #if 0 // Jeff
  1072. // LOG4C((LOG_NOTICE,"生日类型:%s",m_List1array.ElementAt(pos).ElementAt(4)));
  1073. // 生日类型:预产期、
  1074. CString strBirthdayType = "";
  1075. if ( m_List1array.ElementAt(pos).ElementAt(4) == "0")
  1076. {
  1077. strBirthdayType = "宝宝生日";
  1078. }
  1079. else
  1080. {
  1081. strBirthdayType = "预产期";
  1082. }
  1083. m_List1.m_arLabels.ElementAt (i).SetAt (4, strBirthdayType );
  1084. #else
  1085. m_List1.m_arLabels.ElementAt (i).SetAt (4, m_List1array.ElementAt (pos).ElementAt(4) );
  1086. #endif
  1087. m_List1.m_arLabels.ElementAt (i).SetAt (5, m_List1array.ElementAt (pos).ElementAt(5) );
  1088. m_List1.m_arLabels.ElementAt (i).SetAt (6, m_List1array.ElementAt (pos).ElementAt(6) );
  1089. m_List1.m_arLabels.ElementAt (i).SetAt (7, m_List1array.ElementAt (pos).ElementAt(7) );
  1090. m_List1.m_arLabels.ElementAt (i).SetAt (8, m_List1array.ElementAt (pos).ElementAt(8) );
  1091. m_List1.m_arLabels.ElementAt (i).SetAt (9, m_List1array.ElementAt (pos).ElementAt(9) );
  1092. m_List1.m_arLabels.ElementAt (i).SetAt (10, m_List1array.ElementAt (pos).ElementAt(10) );
  1093. m_List1.m_arLabels.ElementAt (i).SetAt (11, m_List1array.ElementAt (pos).ElementAt(11) );
  1094. m_List1.m_arLabels.ElementAt (i).SetAt (12, m_List1array.ElementAt (pos).ElementAt(12) );
  1095. m_List1.m_arLabels.ElementAt (i).SetAt (13, m_List1array.ElementAt (pos).ElementAt(13) );
  1096. m_List1.m_arLabels.ElementAt (i).SetAt (14, m_List1array.ElementAt (pos).ElementAt(14) );
  1097. m_List1.m_arLabels.ElementAt (i).SetAt (15, m_List1array.ElementAt (pos).ElementAt(15) );
  1098. m_List1.m_arLabels.ElementAt (i).SetAt (21, m_List1array.ElementAt (pos).ElementAt(21) );
  1099. m_List1.m_arLabels.ElementAt (i).SetAt (22, m_List1array.ElementAt (pos).ElementAt(22) );
  1100. m_List1.m_arLabels.ElementAt (i).SetAt (23, m_List1array.ElementAt (pos).ElementAt(21) );// add Jeff 0214.05.21
  1101. m_List1.m_arLabels.ElementAt (i).SetAt (24, m_List1array.ElementAt (pos).ElementAt(22) );// add Jeff 0214.05.21
  1102. }
  1103. }
  1104. if(m_List1.m_arLabels.GetSize ())
  1105. {
  1106. CString id=m_List1.m_arLabels.ElementAt (0).ElementAt (0);
  1107. for(int ii=1; ii<m_List1.m_arLabels.GetSize (); ii++)
  1108. {
  1109. if(m_List1.m_arLabels.ElementAt (ii).ElementAt (0)==id)
  1110. {
  1111. m_List1.m_arLabels.ElementAt (ii).SetAt (0, "");
  1112. m_List1.m_arLabels.ElementAt (ii).SetAt (1, "");
  1113. m_List1.m_arLabels.ElementAt (ii).SetAt (2, "");
  1114. m_List1.m_arLabels.ElementAt (ii).SetAt (3, "");
  1115. m_List1.m_arLabels.ElementAt (ii).SetAt (4, "");
  1116. m_List1.m_arLabels.ElementAt (ii).SetAt (5, "");
  1117. m_List1.m_arLabels.ElementAt (ii).SetAt (6, "");
  1118. m_List1.m_arLabels.ElementAt (ii).SetAt (7, "");
  1119. m_List1.m_arLabels.ElementAt (ii).SetAt (8, "");
  1120. m_List1.m_arLabels.ElementAt (ii).SetAt (9, "");
  1121. m_List1.m_arLabels.ElementAt (ii).SetAt (10, "");
  1122. m_List1.m_arLabels.ElementAt (ii).SetAt (11, "");
  1123. m_List1.m_arLabels.ElementAt (ii).SetAt (12, "");
  1124. m_List1.m_arLabels.ElementAt (ii).SetAt (13, "");
  1125. m_List1.m_arLabels.ElementAt (ii).SetAt (14, "");
  1126. m_List1.m_arLabels.ElementAt (ii).SetAt (15, "");
  1127. m_List1.m_arLabels.ElementAt (ii).SetAt (21, "");
  1128. m_List1.m_arLabels.ElementAt (ii).SetAt (22, "");
  1129. m_List1.m_arLabels.ElementAt (ii).SetAt (23, "");// add by Jeff 2014.05.21
  1130. m_List1.m_arLabels.ElementAt (ii).SetAt (24, "");// add by Jeff 2014.05.21
  1131. }
  1132. else
  1133. id=m_List1.m_arLabels.ElementAt (ii).ElementAt (0);
  1134. }
  1135. }
  1136. }
  1137. ii=count;
  1138. m_List1.m_LabelCount=ii;
  1139. m_List1.SetItemCountEx (ii);
  1140. CString str;
  1141. str.Format ("项目:%d", ii);
  1142. SetDlgItemText(IDC_STATIC2, str);
  1143. }