HospitalClient.cpp 33 KB

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