MainFrimDlg2.cpp 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579
  1. // MainFrimDlg2.cpp: implementation of the MainFrimDlg2 class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "YLGL.h"
  6. #include "MainFrimDlg2.h"
  7. #include ".\MenuBarXP\MenuXP.h"
  8. //////////////////////////////////////////////////////////////////////
  9. // Construction/Destruction 图片欣赏
  10. /////////////////////////////////////////////////////////////////////
  11. CArray<CStringArray, CStringArray>g_OutlookBararray;
  12. //#include <afxpriv2.h>
  13. //#include <Atlbase.h>
  14. MainFrimDlg2::MainFrimDlg2()
  15. {
  16. m_bLoadMenu=0;
  17. dataUpdateCentrer.setTodayBar(&m_bar); //add by wangwenbin for Update Centrer 2014-05-03
  18. }
  19. MainFrimDlg2::~MainFrimDlg2()
  20. {
  21. }
  22. void MainFrimDlg2::OnFSCommand(LPCTSTR command, LPCTSTR args)
  23. {
  24. }
  25. void MainFrimDlg2::Init()
  26. {
  27. g_pMainWnd2=this;
  28. CString picdir=g_mainpath+"\\图片\\";
  29. if(g_bRedSkin)
  30. picdir=g_mainpath+"\\图片-红色风格\\";
  31. #ifdef REPL_TITLE
  32. if(::PathFileExists (picdir+"标题.jpg"))
  33. {
  34. Image *img=NULL;
  35. ::LoadImageFromBuf (&img, picdir+"标题.jpg");
  36. int width=img->GetWidth() ;
  37. int height=img->GetHeight() ;
  38. if(height==87)
  39. {
  40. Graphics graph(m_pBk);
  41. Rect destinationRect(0,0,width,height);
  42. graph.DrawImage(img, destinationRect, 0,0,width,height,UnitPixel);
  43. }
  44. delete img;
  45. }
  46. #endif
  47. /* if(0)//::PathFileExists (g_mainpath+"\\zx.dll"))
  48. {
  49. HINSTANCE hinst=::LoadLibrary (g_mainpath+"\\zx.dll");
  50. if(hinst)
  51. {
  52. AfxSetResourceHandle(hinst);
  53. Image *img=NULL;
  54. ::LoadImageFromRes (&img, MAKEINTRESOURCE(2010), "ZX");
  55. AfxSetResourceHandle(AfxGetInstanceHandle());
  56. FreeLibrary(hinst);
  57. ::LoadImageFromBuf (&img, picdir+"标题.jpg");
  58. int width=img->GetWidth() ;
  59. int height=img->GetHeight() ;
  60. Graphics graph(m_pBk);
  61. Rect destinationRect(0,0,width,height);
  62. graph.DrawImage(img, destinationRect, 0,0,width,height,UnitPixel);
  63. delete img;
  64. }
  65. }
  66. else if(::PathFileExists (g_mainpath+"\\zwj.dll"))
  67. {
  68. HINSTANCE hinst=::LoadLibrary (g_mainpath+"\\zwj.dll");
  69. if(hinst)
  70. {
  71. AfxSetResourceHandle(hinst);
  72. Image *img=NULL;
  73. ::LoadImageFromRes (&img, MAKEINTRESOURCE(2010), "ZWJ");
  74. AfxSetResourceHandle(AfxGetInstanceHandle());
  75. FreeLibrary(hinst);
  76. ::LoadImageFromBuf (&img, picdir+"标题.jpg");
  77. int width=img->GetWidth() ;
  78. int height=img->GetHeight() ;
  79. Graphics graph(m_pBk);
  80. Rect destinationRect(0,0,width,height);
  81. graph.DrawImage(img, destinationRect, 0,0,width,height,UnitPixel);
  82. delete img;
  83. }
  84. }*/
  85. if(::PathFileExists (picdir+"背景.jpg"))
  86. {
  87. Image *pImg=NULL;
  88. ::LoadImageFromBuf (&pImg, picdir+"背景.jpg");
  89. if(1660==pImg->GetWidth() && 1177==pImg->GetHeight())
  90. {
  91. Graphics graph(m_pBk);
  92. CRect rc=m_rcarray.ElementAt (16);
  93. rc.left /=g_fscalex;
  94. rc.right /=g_fscalex;
  95. rc.top /=g_fscaley;
  96. rc.bottom /=g_fscaley;
  97. Rect destinationRect(rc.left,rc.top,rc.Width (), rc.Height ());
  98. graph.DrawImage(pImg, destinationRect, 0,0,pImg->GetWidth(),pImg->GetHeight(),UnitPixel);
  99. }
  100. delete pImg;
  101. }
  102. CRect rc;
  103. HWND wnd = ::FindWindow("Shell_TrayWnd", 0);
  104. ::GetWindowRect (wnd, &rc);
  105. int hei=rc.Height ();
  106. rc=CRect(0,0,g_screenwid,g_screenhei-hei);
  107. MoveWindow(rc);
  108. {
  109. CRgn rgn1, rgn2, rgn3;
  110. CRect rc=m_rcarray.ElementAt (16);
  111. rgn2.CreateRectRgn (rc.left , rc.top , rc.right , rc.bottom );
  112. ::SetWindowRgn (g_pMainWnd->m_hWnd, rgn2, 0);
  113. }
  114. /* GetWindowRect(rc);
  115. rc.bottom -=rc.top ;
  116. rc.top =0;
  117. MoveWindow(rc);*/
  118. /* ((MyBmpButton2*)m_picarray.ElementAt (0))->m_bAutoFocusImg=1; //已配图
  119. ((MyBmpButton2*)m_picarray.ElementAt (1))->m_bAutoFocusImg=1;
  120. ((MyBmpButton2*)m_picarray.ElementAt (2))->m_bAutoFocusImg=1;
  121. ((MyBmpButton2*)m_picarray.ElementAt (3))->m_bAutoFocusImg=1;
  122. ((MyBmpButton2*)m_picarray.ElementAt (4))->m_bAutoFocusImg=1;
  123. ((MyBmpButton2*)m_picarray.ElementAt (5))->m_bAutoFocusImg=1;
  124. ((MyBmpButton2*)m_picarray.ElementAt (6))->m_bAutoFocusImg=1; */
  125. ((MyBmpButton2*)m_picarray.ElementAt (11))->m_bAutoFocusImg=1;
  126. ((MyBmpButton2*)m_picarray.ElementAt (12))->m_bAutoFocusImg=1;
  127. ((MyBmpButton2*)m_picarray.ElementAt (13))->m_bAutoFocusImg=1;
  128. ((MyBmpButton2*)m_picarray.ElementAt (28))->m_bAutoFocusImg=1;
  129. ///////////////////////flash
  130. rc=m_rcarray.ElementAt (16);
  131. rc.left=rc.right-115;
  132. rc.top=rc.bottom-35;
  133. ((MyBmpButton2*)m_picarray.ElementAt (17))->MoveWindow(rc);
  134. //////////////////////////////////
  135. Init2();
  136. rc=m_rcarray.ElementAt (16);
  137. CRect oldmainrc=g_rc;
  138. g_rc=rc;
  139. g_dx=g_rc.left -oldmainrc.left ;
  140. g_dy=g_rc.top -oldmainrc.top ;
  141. g_WidthScale = ((float)g_rc.Width ())/722.0;
  142. g_HeightScale = ((float)g_rc.Height ())/533.0;
  143. if(g_screenwid==2560 && g_screenhei==1440)
  144. {
  145. // m_WidthScale*=0.775;
  146. // m_HeightScale*=0.76;
  147. }
  148. if(g_screenwid==1920 && g_screenhei==1440)
  149. {
  150. // m_WidthScale*=0.775;
  151. // m_HeightScale*=0.76;
  152. }
  153. #ifndef BASIC_VERSION
  154. m_bar.Create (IDD_DLGtodaybar, this);
  155. rc=g_rc;rc.bottom =rc.top +20;
  156. rc.left ++;
  157. rc.right -=2;
  158. m_bar.MoveWindow (rc);
  159. #endif
  160. }
  161. void MainFrimDlg2::Destory()
  162. {
  163. }
  164. void MainFrimDlg2::BtnClick(WPARAM wParam, LPARAM lParam)
  165. {
  166. int id=lParam;
  167. id -= 99;
  168. switch(id)
  169. {
  170. case 14:
  171. g_pMainWnd->OnClose2();
  172. break;
  173. case 12:
  174. ::SendMessage(g_pMainWnd->GetSafeHwnd (),WM_SYSCOMMAND,SC_MINIMIZE,0);
  175. break;
  176. case 8:
  177. case 9:
  178. case 10:
  179. case 11:
  180. ShowMenu(id-8);
  181. break;
  182. case 1:
  183. g_pMainWnd->OnCommandMenu(IDM_TODAY);
  184. break;
  185. case 2:
  186. g_pMainWnd->OnCommandMenu(IDM_DINDAN);
  187. break;
  188. case 3:
  189. g_pMainWnd->OnCommandMenu(IDM_TAKECONTROL);
  190. break;
  191. case 4:
  192. g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
  193. break;
  194. case 5:
  195. g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
  196. break;
  197. case 6:
  198. g_pMainWnd->OnCommandMenu(IDM_Daily);
  199. break;
  200. case 7:
  201. g_pMainWnd->OnCommandMenu(IDM_ProcessAlarm);
  202. break;
  203. break;
  204. case 29:
  205. if(g_bRedSkin)
  206. {
  207. if(AfxMessageBox("确定切换成蓝色风格界面吗?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  208. CString version = _T ("Version 1.0");
  209. AfxGetApp()->WriteProfileInt (version, "redskin", 0);
  210. AfxMessageBox("切换成功,重启软件生效!", MB_ICONINFORMATION);
  211. }
  212. else
  213. {
  214. if(0==::PathFileExists(g_mainpath+"\\skin\\10-red.lia"))
  215. {
  216. AfxMessageBox("红色界面包尚未安装,请通知系统管理员!", MB_ICONINFORMATION);
  217. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  218. return;
  219. }
  220. if(AfxMessageBox("确定切换成红色风格界面吗?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  221. CString version = _T ("Version 1.0");
  222. AfxGetApp()->WriteProfileInt (version, "redskin", 1);
  223. AfxMessageBox("切换成功,重启软件生效!", MB_ICONINFORMATION);
  224. }
  225. break;
  226. }
  227. }
  228. BOOL MainFrimDlg2::PreTransMsg(MSG* pMsg)
  229. {
  230. if(pMsg->message==WM_KEYDOWN)
  231. {
  232. switch (pMsg->wParam)
  233. {
  234. case VK_ESCAPE:
  235. case VK_RETURN:
  236. return 1;
  237. }
  238. }
  239. else if(pMsg->message==WM_PAINT && pMsg->hwnd ==this->m_hWnd )
  240. {
  241. SetTimer(1, 100, NULL);
  242. // DrawLogin();
  243. }
  244. else if(pMsg->message==WM_TIMER&& pMsg->hwnd ==this->m_hWnd)
  245. {
  246. KillTimer(1);
  247. // LOG4C((LOG_NOTICE,"DrawLogin"));
  248. DrawLogin();
  249. }
  250. else if(pMsg->message==WM_LBUTTONUP)
  251. {
  252. CPoint pt;
  253. GetCursorPos(&pt);
  254. ScreenToClient(&pt);
  255. CRect rc;
  256. rc=m_rcarray.ElementAt (11);
  257. if(rc.PtInRect (pt))
  258. ::SendMessage(g_pMainWnd->GetSafeHwnd (),WM_SYSCOMMAND,SC_MINIMIZE,0);
  259. rc=m_rcarray.ElementAt (16);
  260. rc.left=rc.right-115;
  261. rc.top=rc.bottom-35;
  262. if(rc.PtInRect (pt))
  263. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  264. }
  265. else if(pMsg->message==WM_LBUTTONDBLCLK)
  266. {
  267. CPoint pt;
  268. GetCursorPos(&pt);
  269. ScreenToClient(&pt);
  270. CRect rc;
  271. GetClientRect(rc);
  272. CPoint pt2=rc.CenterPoint ();
  273. rc.left =pt2.x-20;
  274. rc.right =pt2.x+20;
  275. rc.top =pt2.y-10;
  276. rc.bottom =pt2.y+10;
  277. if(rc.PtInRect (pt) && g_pMainWnd->IsShiftDown() && g_pMainWnd->IsCtrlDown() )
  278. {
  279. MessageBox("版权所有:惠州市利亚方舟科技有限公司\r\n电话:0752-2398865\r\n网址:www.lyfz.net");
  280. }
  281. }
  282. return g_pMainWnd->PreTranslateMessage(pMsg);
  283. return CDialog::PreTranslateMessage(pMsg);
  284. }
  285. /*
  286. typedef struct gifImage{
  287. WORD lWidth;
  288. WORD lHeight;
  289. WORD width;
  290. WORD height;
  291. struct flag{
  292. BYTE d:3;
  293. BYTE c:1;
  294. BYTE b:3;
  295. BYTE a:1;
  296. }Flag;
  297. }GifImage,*PGifImage;
  298. #include <math.h>
  299. static UINT GifThread(LPVOID gifDC)
  300. {
  301. CDC* pdc = (CDC*)gifDC;
  302. HINSTANCE handle = ::AfxGetResourceHandle();
  303. HRSRC hrsrc = ::FindResource(handle,MAKEINTRESOURCE(IDR_GIF1),"GIF");
  304. DWORD word = ::SizeofResource(handle,hrsrc);
  305. BYTE* lpBy = (BYTE*)LoadResource(handle,hrsrc);
  306. BYTE* pByte[20];
  307. DWORD nu[20];
  308. int num = 0;
  309. DWORD firstLocation = 0;
  310. for(DWORD j=0;j<word;j++)
  311. {
  312. if(lpBy[j]==0x2c)
  313. {
  314. if(lpBy[j-1]==0x00)
  315. {
  316. if(num==0)
  317. {
  318. firstLocation = j;
  319. }
  320. PGifImage nowImage = (PGifImage)&lpBy[j+1];
  321. if(nowImage->Flag.a==0)
  322. {
  323. DWORD number = 1+sizeof(GifImage);
  324. while(lpBy[j+number]!=0)
  325. {
  326. number = number+(DWORD)lpBy[j+number]+1;
  327. }
  328. number++;
  329. pByte[num] = new BYTE[number];
  330. for(DWORD n=0;n<number;n++)
  331. {
  332. *(BYTE*)(pByte[num]+n) = lpBy[j+n];
  333. }
  334. nu[num] = number;
  335. j = j+number-1;
  336. num++;
  337. }
  338. else
  339. {
  340. int number = 1+sizeof(GifImage)+1+3*(int)floor(pow(2,nowImage->Flag.d));
  341. while(lpBy[j+number]!=0)
  342. {
  343. number = number+lpBy[j+number];
  344. }
  345. pByte[num] = new BYTE[number];
  346. for(int n=0;n<number;n++)
  347. {
  348. *(BYTE*)(pByte[num]+n) = lpBy[j+n];
  349. }
  350. nu[num] = number;
  351. j = j+number-1;
  352. num++;
  353. }
  354. }
  355. }
  356. }
  357. int i = 1;
  358. while(i)
  359. {
  360. for(int m=0;m<num;m++)
  361. {
  362. CBrush brush(RGB(255,255,255));
  363. pdc->FillRect(CRect(0,0,500,500),&brush);
  364. DWORD DDD;
  365. VirtualProtect(lpBy,word,PAGE_READWRITE,&DDD);
  366. for(DWORD n=0;n<nu[m];n++)
  367. {
  368. lpBy[firstLocation+n] = *(BYTE*)(pByte[m]+n);
  369. }
  370. VirtualProtect(lpBy,word,DDD,NULL);
  371. CMemFile file(lpBy,word);
  372. CArchive ar(&file,CArchive::load|CArchive::bNoFlushOnDelete);
  373. CArchiveStream arcstream(&ar);
  374. CComQIPtr<IPicture> m_picture;
  375. HRESULT hr = OleLoadPicture((LPSTREAM)&arcstream,0,false,IID_IPicture,(void**)&m_picture);
  376. long a,b;
  377. m_picture->get_Width(&a);
  378. m_picture->get_Height(&b);
  379. CSize sz(a,b);
  380. pdc->HIMETRICtoDP(&sz);
  381. CRect rect;
  382. m_picture->Render(*pdc,0,0,sz.cx,sz.cy,0,b,a,-b,&rect);
  383. Sleep(100);
  384. }
  385. }
  386. return 1;
  387. }
  388. CDC* m_gifDC=NULL;*/
  389. void MainFrimDlg2::Init2()
  390. {
  391. CRect rc=m_rcarray.ElementAt (15);
  392. // rc.top-=5;
  393. // rc.bottom-=7;
  394. if (!m_wndOutlookBar.Create(WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN, rc, this, 0, OBS_XT_DEFAULT))
  395. {
  396. TRACE0("Failed to create outlook bar.");
  397. return;
  398. }
  399. // Set the background and text color of the outlook bar.
  400. if(g_bRedSkin)
  401. m_wndOutlookBar.SetBackColor(RGB(112,29,55));
  402. else
  403. m_wndOutlookBar.SetBackColor(RGB(70,70,70));
  404. m_wndOutlookBar.SetTextColor(RGB(0xff,0xff,0xff));
  405. // Add items to the outlook bar.
  406. InitializeOutlookBar();
  407. // CDC* pdc = GetDC();
  408. // m_gifDC = new CDC;
  409. // m_gifDC->Attach(pdc->GetSafeHdc());
  410. // AfxBeginThread(GifThread,(LPVOID)m_gifDC);
  411. }
  412. static UINT nIcons[] =
  413. {
  414. IDI_ICON1, IDI_ICON3, IDI_ICON4, IDI_ICON7,
  415. IDI_ICON8, IDI_ICON2, IDI_ICON11, IDI_ICON6,
  416. IDI_ICON9, IDI_ICON10, IDI_ICON5
  417. };
  418. // 初始化侧边栏;
  419. void MainFrimDlg2::InitializeOutlookBar()
  420. {
  421. // Create the image lists used by the outlook bar.
  422. m_ImageSmall.Create (16, 16, ILC_COLOR16|ILC_MASK, 2, 1);
  423. m_ImageLarge.Create (32, 32, ILC_COLOR16|ILC_MASK, 2, 1);
  424. // initiailize the image lists.
  425. for (int i = 0; i < 11; ++i)
  426. {
  427. HICON hIcon = AfxGetApp()->LoadIcon(nIcons[i]);
  428. ASSERT(hIcon);
  429. m_ImageSmall.Add(hIcon);
  430. m_ImageLarge.Add(hIcon);
  431. }
  432. int iFolder; // index of the added folder
  433. /* CString version = _T ("Version 1.0");
  434. CString rights=AfxGetApp()->GetProfileString (version, "hidewindow", "");
  435. if(rights.IsEmpty ())rights="111111111111111";
  436. BOOL bHide=AfxGetApp()->GetProfileInt (version, "hidewindow2", 0);
  437. */
  438. CString rights;
  439. int foldercount=0;
  440. // set the image lists for the outlook bar.
  441. m_wndOutlookBar.SetImageList(&m_ImageLarge, OBS_XT_LARGEICON);
  442. m_wndOutlookBar.SetImageList(&m_ImageSmall, OBS_XT_SMALLICON);
  443. #ifdef BASIC_VERSION
  444. if(IsHasRight(rights,"门市流程"))
  445. {
  446. // Add the first folder to the outlook bar.
  447. iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), foldercount);foldercount++;
  448. // Add items to the folder, syntax is folder, index, text, image, and item data.
  449. m_wndOutlookBar.InsertItem(iFolder, 1, _T("开单"), 0, NULL);
  450. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拍照"), 1, NULL);
  451. m_wndOutlookBar.InsertItem(iFolder, 3, _T("修片"), 2, NULL);
  452. m_wndOutlookBar.InsertItem(iFolder, 4, _T("选片"), 3, NULL);
  453. m_wndOutlookBar.InsertItem(iFolder, 5, _T("精修"), 4, NULL);
  454. m_wndOutlookBar.InsertItem(iFolder, 6, _T("设计"), 5, NULL);
  455. m_wndOutlookBar.InsertItem(iFolder, 7, _T("刻盘"), 6, NULL);
  456. m_wndOutlookBar.InsertItem(iFolder, 8, _T("发片/取件"), 7, NULL);
  457. m_wndOutlookBar.InsertItem(iFolder, 9, _T("数码安排"), 8, NULL);
  458. }
  459. if(IsHasRight(rights,"财务管理"))
  460. {
  461. // Add the second folder to the outlook bar.
  462. iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), foldercount);foldercount++;
  463. // Add items to the folder, syntax is folder, index, text, image, and item data.
  464. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单收款"), 0, NULL);
  465. m_wndOutlookBar.InsertItem(iFolder, 2, _T("现金支出"), 1, NULL);
  466. m_wndOutlookBar.InsertItem(iFolder, 3, _T("其它收入"), 2, NULL);
  467. m_wndOutlookBar.InsertItem(iFolder, 4, _T("其它二销"), 3, NULL);
  468. // m_wndOutlookBar.InsertItem(iFolder, 5, _T("员工奖罚"), 4, NULL);
  469. // m_wndOutlookBar.InsertItem(iFolder, 6, _T("日财务表"), 5, NULL);
  470. // m_wndOutlookBar.InsertItem(iFolder, 7, _T("工资管理"), 6, NULL);
  471. m_wndOutlookBar.InsertItem(iFolder, 5, _T("客人付款"), 6, NULL);
  472. }
  473. //if(IsHasRight(rights,"短信群发"))
  474. if(IsHasRight(rights,"短信管理"))
  475. {
  476. //iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), foldercount);foldercount++;
  477. iFolder = m_wndOutlookBar.AddFolder(_T("短信管理"), foldercount);foldercount++;
  478. // Add items to the folder, syntax is folder, index, text, image, and item data.
  479. m_wndOutlookBar.InsertItem(iFolder, 1, _T("短信群发"), 0, NULL);
  480. m_wndOutlookBar.InsertItem(iFolder, 2, _T("短信发送"), 1, NULL);
  481. m_wndOutlookBar.InsertItem(iFolder, 3, _T("流程短信"), 2, NULL);
  482. m_wndOutlookBar.InsertItem(iFolder, 4, _T("员工短信"), 3, NULL);
  483. m_wndOutlookBar.InsertItem(iFolder, 5, _T("发送记录"), 4, NULL);
  484. m_wndOutlookBar.InsertItem(iFolder, 6, _T("短信设置"), 5, NULL);
  485. }
  486. #ifdef BASIC_ADDPHONE
  487. if(IsHasRight(rights,"客户管理"))
  488. {
  489. iFolder = m_wndOutlookBar.AddFolder(_T("客户管理"), foldercount);foldercount++;
  490. // Add items to the folder, syntax is folder, index, text, image, and item data.
  491. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单客户"), 0, NULL);
  492. m_wndOutlookBar.InsertItem(iFolder, 2, _T("老客户"), 1, NULL);
  493. m_wndOutlookBar.InsertItem(iFolder, 3, _T("意向客户"), 2, NULL);
  494. m_wndOutlookBar.InsertItem(iFolder, 4, _T("客户流失"), 3, NULL);
  495. m_wndOutlookBar.InsertItem(iFolder, 5, _T("客户来源"), 4, NULL);
  496. }
  497. #endif
  498. #ifdef BASIC_ADDDRESS
  499. if(IsHasRight(rights,"礼服管理"))
  500. {
  501. iFolder = m_wndOutlookBar.AddFolder(_T("礼服管理"), foldercount);foldercount++;
  502. // Add items to the folder, syntax is folder, index, text, image, and item data.
  503. m_wndOutlookBar.InsertItem(iFolder, 1, _T("礼服录入"), 0, NULL);
  504. m_wndOutlookBar.InsertItem(iFolder, 2, _T("礼服查看"), 1, NULL);
  505. m_wndOutlookBar.InsertItem(iFolder, 3, _T("撞期预警"), 2, NULL);
  506. m_wndOutlookBar.InsertItem(iFolder, 4, _T("图片欣赏"), 3, NULL);
  507. m_wndOutlookBar.InsertItem(iFolder, 5, _T("礼服出租"), 4, NULL);
  508. }
  509. #endif
  510. if(IsHasRight(rights,"来电精灵"))
  511. {
  512. iFolder = m_wndOutlookBar.AddFolder(_T("来电精灵"), foldercount);foldercount++;
  513. // Add items to the folder, syntax is folder, index, text, image, and item data.
  514. m_wndOutlookBar.InsertItem(iFolder, 1, _T("客户来电"), 0, NULL);
  515. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拨出电话"), 1, NULL);
  516. m_wndOutlookBar.InsertItem(iFolder, 3, _T("未接来电"), 2, NULL);
  517. }
  518. #ifdef BASIC_ADDMEMBER
  519. if(IsHasRight(rights,"会员管理"))
  520. {
  521. iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), foldercount);foldercount++;
  522. // Add items to the folder, syntax is folder, index, text, image, and item data.
  523. m_wndOutlookBar.InsertItem(iFolder, 1, _T("金卡会员"), 0, NULL);
  524. m_wndOutlookBar.InsertItem(iFolder, 2, _T("转介绍积分"), 1, NULL);
  525. m_wndOutlookBar.InsertItem(iFolder, 3, _T("转介绍图表"), 2, NULL);
  526. m_wndOutlookBar.InsertItem(iFolder, 4, _T("蓝钻会员"), 3, NULL);
  527. m_wndOutlookBar.InsertItem(iFolder, 4, _T("转介绍返现"), 4, NULL);
  528. m_wndOutlookBar.InsertItem(iFolder, 5, _T("转介绍图表2"), 5, NULL);
  529. m_wndOutlookBar.InsertItem(iFolder, 6, _T("积分设置"),6, NULL);
  530. }
  531. #endif
  532. #else
  533. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  534. RefreshOutlookBar();
  535. #endif
  536. }
  537. /*
  538. void MainFrimDlg2::InitializeOutlookBar()
  539. {
  540. // Create the image lists used by the outlook bar.
  541. m_ImageSmall.Create (16, 16, ILC_COLOR16|ILC_MASK, 2, 1);
  542. m_ImageLarge.Create (32, 32, ILC_COLOR16|ILC_MASK, 2, 1);
  543. // initiailize the image lists.
  544. for (int i = 0; i < 11; ++i)
  545. {
  546. HICON hIcon = AfxGetApp()->LoadIcon(nIcons[i]);
  547. ASSERT(hIcon);
  548. m_ImageSmall.Add(hIcon);
  549. m_ImageLarge.Add(hIcon);
  550. }
  551. int iFolder; // index of the added folder
  552. // set the image lists for the outlook bar.
  553. m_wndOutlookBar.SetImageList(&m_ImageLarge, OBS_XT_LARGEICON);
  554. m_wndOutlookBar.SetImageList(&m_ImageSmall, OBS_XT_SMALLICON);
  555. #ifdef BASIC_VERSION
  556. // Add the first folder to the outlook bar.
  557. iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), 0);
  558. // Add items to the folder, syntax is folder, index, text, image, and item data.
  559. m_wndOutlookBar.InsertItem(iFolder, 1, _T("开单"), 0, NULL);
  560. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拍照"), 1, NULL);
  561. m_wndOutlookBar.InsertItem(iFolder, 3, _T("修片"), 2, NULL);
  562. m_wndOutlookBar.InsertItem(iFolder, 4, _T("选片"), 3, NULL);
  563. m_wndOutlookBar.InsertItem(iFolder, 5, _T("精修"), 4, NULL);
  564. m_wndOutlookBar.InsertItem(iFolder, 6, _T("设计"), 5, NULL);
  565. m_wndOutlookBar.InsertItem(iFolder, 7, _T("刻盘"), 6, NULL);
  566. m_wndOutlookBar.InsertItem(iFolder, 8, _T("发片/取件"), 7, NULL);
  567. m_wndOutlookBar.InsertItem(iFolder, 9, _T("数码安排"), 8, NULL);
  568. // Add the second folder to the outlook bar.
  569. iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), 1);
  570. // Add items to the folder, syntax is folder, index, text, image, and item data.
  571. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单收款"), 0, NULL);
  572. m_wndOutlookBar.InsertItem(iFolder, 2, _T("现金支出"), 1, NULL);
  573. m_wndOutlookBar.InsertItem(iFolder, 3, _T("其它收入"), 2, NULL);
  574. m_wndOutlookBar.InsertItem(iFolder, 4, _T("其它二销"), 3, NULL);
  575. // m_wndOutlookBar.InsertItem(iFolder, 5, _T("员工奖罚"), 4, NULL);
  576. // m_wndOutlookBar.InsertItem(iFolder, 6, _T("日财务表"), 5, NULL);
  577. // m_wndOutlookBar.InsertItem(iFolder, 7, _T("工资管理"), 6, NULL);
  578. m_wndOutlookBar.InsertItem(iFolder, 5, _T("客人付款"), 6, NULL);
  579. iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), 2);
  580. // Add items to the folder, syntax is folder, index, text, image, and item data.
  581. m_wndOutlookBar.InsertItem(iFolder, 1, _T("短信群发"), 0, NULL);
  582. m_wndOutlookBar.InsertItem(iFolder, 2, _T("短信发送"), 1, NULL);
  583. m_wndOutlookBar.InsertItem(iFolder, 3, _T("流程短信"), 2, NULL);
  584. m_wndOutlookBar.InsertItem(iFolder, 4, _T("员工短信"), 3, NULL);
  585. m_wndOutlookBar.InsertItem(iFolder, 5, _T("发送记录"), 4, NULL);
  586. m_wndOutlookBar.InsertItem(iFolder, 6, _T("短信设置"), 5, NULL);
  587. #ifdef BASIC_ADDMEMBER
  588. iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), 3);
  589. // Add items to the folder, syntax is folder, index, text, image, and item data.
  590. m_wndOutlookBar.InsertItem(iFolder, 1, _T("金卡会员"), 0, NULL);
  591. m_wndOutlookBar.InsertItem(iFolder, 2, _T("转介绍积分"), 1, NULL);
  592. m_wndOutlookBar.InsertItem(iFolder, 3, _T("转介绍图表"), 2, NULL);
  593. m_wndOutlookBar.InsertItem(iFolder, 4, _T("蓝钻会员"), 3, NULL);
  594. m_wndOutlookBar.InsertItem(iFolder, 4, _T("转介绍返现"), 4, NULL);
  595. m_wndOutlookBar.InsertItem(iFolder, 5, _T("转介绍图表2"), 5, NULL);
  596. m_wndOutlookBar.InsertItem(iFolder, 6, _T("积分设置"),6, NULL);
  597. #endif
  598. #else
  599. // Add the first folder to the outlook bar.
  600. iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), 0);
  601. // Add items to the folder, syntax is folder, index, text, image, and item data.
  602. m_wndOutlookBar.InsertItem(iFolder, 1, _T("开单"), 0, NULL);
  603. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拍照"), 1, NULL);
  604. m_wndOutlookBar.InsertItem(iFolder, 3, _T("修片"), 2, NULL);
  605. m_wndOutlookBar.InsertItem(iFolder, 4, _T("选片"), 3, NULL);
  606. m_wndOutlookBar.InsertItem(iFolder, 5, _T("精修"), 4, NULL);
  607. m_wndOutlookBar.InsertItem(iFolder, 6, _T("设计"), 5, NULL);
  608. m_wndOutlookBar.InsertItem(iFolder, 7, _T("刻盘"), 6, NULL);
  609. m_wndOutlookBar.InsertItem(iFolder, 8, _T("发片/取件"), 7, NULL);
  610. m_wndOutlookBar.InsertItem(iFolder, 9, _T("数码安排"), 8, NULL);
  611. // Add the second folder to the outlook bar.
  612. iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), 1);
  613. // Add items to the folder, syntax is folder, index, text, image, and item data.
  614. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单收款"), 0, NULL);
  615. m_wndOutlookBar.InsertItem(iFolder, 2, _T("现金支出"), 1, NULL);
  616. m_wndOutlookBar.InsertItem(iFolder, 3, _T("其它收入"), 2, NULL);
  617. m_wndOutlookBar.InsertItem(iFolder, 4, _T("其它二销"), 3, NULL);
  618. m_wndOutlookBar.InsertItem(iFolder, 5, _T("员工奖罚"), 4, NULL);
  619. m_wndOutlookBar.InsertItem(iFolder, 6, _T("日财务表"), 5, NULL);
  620. m_wndOutlookBar.InsertItem(iFolder, 7, _T("工资管理"), 6, NULL);
  621. m_wndOutlookBar.InsertItem(iFolder, 8, _T("客人付款"), 7, NULL);
  622. iFolder = m_wndOutlookBar.AddFolder(_T("统计查询"), 2);
  623. // Add items to the folder, syntax is folder, index, text, image, and item data.
  624. m_wndOutlookBar.InsertItem(iFolder, 1, _T("日财务表"), 0, NULL);
  625. m_wndOutlookBar.InsertItem(iFolder, 2, _T("月财务表"), 1, NULL);
  626. m_wndOutlookBar.InsertItem(iFolder, 3, _T("年财务表"), 2, NULL);
  627. m_wndOutlookBar.InsertItem(iFolder, 4, _T("年财务图表"), 3, NULL);
  628. m_wndOutlookBar.InsertItem(iFolder, 5, _T("工资报表"), 4, NULL);
  629. m_wndOutlookBar.InsertItem(iFolder, 6, _T("员工业绩"), 5, NULL);
  630. m_wndOutlookBar.InsertItem(iFolder, 7, _T("员工资料"), 6, NULL);
  631. m_wndOutlookBar.InsertItem(iFolder, 8, _T("员工奖惩"), 7, NULL);
  632. m_wndOutlookBar.InsertItem(iFolder, 9, _T("客户区域"), 8, NULL);
  633. iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), 3);
  634. // Add items to the folder, syntax is folder, index, text, image, and item data.
  635. m_wndOutlookBar.InsertItem(iFolder, 1, _T("短信群发"), 0, NULL);
  636. m_wndOutlookBar.InsertItem(iFolder, 2, _T("短信发送"), 1, NULL);
  637. m_wndOutlookBar.InsertItem(iFolder, 3, _T("流程短信"), 2, NULL);
  638. m_wndOutlookBar.InsertItem(iFolder, 4, _T("员工短信"), 3, NULL);
  639. m_wndOutlookBar.InsertItem(iFolder, 5, _T("发送记录"), 4, NULL);
  640. m_wndOutlookBar.InsertItem(iFolder, 6, _T("短信设置"), 5, NULL);
  641. iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), 4);
  642. // Add items to the folder, syntax is folder, index, text, image, and item data.
  643. m_wndOutlookBar.InsertItem(iFolder, 1, _T("金卡会员"), 0, NULL);
  644. m_wndOutlookBar.InsertItem(iFolder, 2, _T("转介绍积分"), 1, NULL);
  645. m_wndOutlookBar.InsertItem(iFolder, 3, _T("转介绍图表"), 2, NULL);
  646. m_wndOutlookBar.InsertItem(iFolder, 4, _T("蓝钻会员"), 3, NULL);
  647. m_wndOutlookBar.InsertItem(iFolder, 4, _T("转介绍返现"), 4, NULL);
  648. m_wndOutlookBar.InsertItem(iFolder, 5, _T("转介绍图表2"), 5, NULL);
  649. m_wndOutlookBar.InsertItem(iFolder, 6, _T("积分设置"),6, NULL);
  650. iFolder = m_wndOutlookBar.AddFolder(_T("礼服管理"), 5);
  651. // Add items to the folder, syntax is folder, index, text, image, and item data.
  652. m_wndOutlookBar.InsertItem(iFolder, 1, _T("礼服录入"), 0, NULL);
  653. m_wndOutlookBar.InsertItem(iFolder, 2, _T("礼服查看"), 1, NULL);
  654. m_wndOutlookBar.InsertItem(iFolder, 3, _T("图片欣赏"), 2, NULL);
  655. m_wndOutlookBar.InsertItem(iFolder, 4, _T("礼服出租"), 3, NULL);
  656. iFolder = m_wndOutlookBar.AddFolder(_T("库存管理"), 6);
  657. // Add items to the folder, syntax is folder, index, text, image, and item data.
  658. m_wndOutlookBar.InsertItem(iFolder, 1, _T("商品类别设置"), 0, NULL);
  659. m_wndOutlookBar.InsertItem(iFolder, 2, _T("商品名称设置"), 1, NULL);
  660. m_wndOutlookBar.InsertItem(iFolder, 3, _T("入库单"), 2, NULL);
  661. m_wndOutlookBar.InsertItem(iFolder, 4, _T("出库单"), 3, NULL);
  662. m_wndOutlookBar.InsertItem(iFolder, 5, _T("库存查询"), 4, NULL);
  663. m_wndOutlookBar.InsertItem(iFolder, 6, _T("商品图表"), 5, NULL);
  664. iFolder = m_wndOutlookBar.AddFolder(_T("客户管理"), 7);
  665. // Add items to the folder, syntax is folder, index, text, image, and item data.
  666. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单客户"), 0, NULL);
  667. m_wndOutlookBar.InsertItem(iFolder, 2, _T("意向客户"), 1, NULL);
  668. m_wndOutlookBar.InsertItem(iFolder, 3, _T("客户流失"), 2, NULL);
  669. m_wndOutlookBar.InsertItem(iFolder, 4, _T("客户来源"), 3, NULL);
  670. iFolder = m_wndOutlookBar.AddFolder(_T("来电精灵"), 8);
  671. // Add items to the folder, syntax is folder, index, text, image, and item data.
  672. m_wndOutlookBar.InsertItem(iFolder, 1, _T("客户来电"), 0, NULL);
  673. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拨出电话"), 1, NULL);
  674. m_wndOutlookBar.InsertItem(iFolder, 3, _T("未接来电"), 2, NULL);
  675. #ifdef ADD_LOGIN
  676. iFolder = m_wndOutlookBar.AddFolder(_T("员工考勤"), 9);
  677. // Add items to the folder, syntax is folder, index, text, image, and item data.
  678. m_wndOutlookBar.InsertItem(iFolder, 1, _T("考勤记录"), 0, NULL);
  679. m_wndOutlookBar.InsertItem(iFolder, 2, _T("时间设置"), 1, NULL);
  680. m_wndOutlookBar.InsertItem(iFolder, 3, _T("排班设置"), 2, NULL);
  681. #endif
  682. #endif
  683. // Add the tree control to the outlook bar.
  684. //xu iFolder = m_wndOutlookBar.AddFolderBar(_T("Tree Control"), &m_wndTreeCtrl );
  685. // Set the default font used by the outlook bar.
  686. //xu m_wndOutlookBar.SetFontX(&xtAfxData.font);
  687. // We want to receive notification messages.
  688. m_wndOutlookBar.SetOwner(this);
  689. // Select the first folder in the bar.
  690. m_wndOutlookBar.SetSelFolder(0);
  691. }
  692. */
  693. LRESULT MainFrimDlg2::OnOutbarNotify(WPARAM wParam, LPARAM lParam)
  694. {
  695. int nBarAction = (int)wParam;
  696. // Cast the lParam to a XT_OUTBAR_INFO* struct pointer.
  697. XT_OUTBAR_INFO* pOBInfo = (XT_OUTBAR_INFO*)lParam;
  698. ASSERT(pOBInfo);
  699. switch (nBarAction)
  700. {
  701. case OBN_XT_ITEMCLICK:
  702. {
  703. CString strMsg=pOBInfo->lpszText;
  704. g_pMainWnd->OnOutbarNotify (strMsg);
  705. // AfxMessageBox(strMsg);
  706. // TRACE2( "Item selected: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  707. }
  708. break;
  709. /* case OBN_XT_FOLDERCHANGE:
  710. TRACE2( "Folder selected: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  711. break;
  712. case OBN_XT_ONLABELENDEDIT:
  713. TRACE2( "Item edited: %d, New name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  714. break;
  715. case OBN_XT_ONGROUPENDEDIT:
  716. TRACE2( "Folder edited: %d, New name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  717. break;
  718. case OBN_XT_DRAGITEM:
  719. TRACE3( "Dragging From: %d, To: %d, Name: %s.\n", pOBInfo->nDragFrom, pOBInfo->nDragTo, pOBInfo->lpszText);
  720. break;
  721. case OBN_XT_ITEMHOVER:
  722. TRACE2( "Hovering Item: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  723. break;
  724. case OBN_XT_DELETEITEM:
  725. if (!m_bDestroy && AfxMessageBox(_T("Are you sure you want to remove this folder shortcut?"),
  726. MB_ICONWARNING|MB_YESNO) == IDNO)
  727. {
  728. // The user selected No, return FALSE to abort the action.
  729. return FALSE;
  730. }
  731. TRACE2( "Item deleted: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  732. break;
  733. case OBN_XT_DELETEFOLDER:
  734. if (!m_bDestroy && AfxMessageBox(_T("Are you sure you want to remove the specified folder?"),
  735. MB_ICONWARNING|MB_YESNO) == IDNO)
  736. {
  737. // The user selected No, return FALSE to abort the action.
  738. return FALSE;
  739. }
  740. TRACE2( "Folder deleted: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  741. break;*/
  742. }
  743. return TRUE;
  744. }
  745. void MainFrimDlg2::SetSelFolder(int pos)
  746. {
  747. m_wndOutlookBar.SetSelFolder(pos);
  748. }
  749. void MainFrimDlg2::ShowMenu(int pos)
  750. {
  751. m_bLoadMenu=1;m_nMenuPos=pos;
  752. CRect rc=m_rcarray.ElementAt (7+pos);
  753. CMenuXP *pPopup;
  754. pPopup = new CMenuXP;
  755. pPopup->CYBUTTONMARGIN=3;
  756. pPopup->CreatePopupMenu();
  757. pPopup->SetMenuStyle(CMenuXP::STYLE_XP);
  758. CString text;
  759. {
  760. CMenu *pMenu=g_pMainWnd->GetMenu();
  761. CMenu* submenu = pMenu->GetSubMenu(pos);
  762. CString version = _T ("Version 1.0");
  763. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  764. CArray<DWORD,DWORD>delidarray;
  765. int count=g_pMainWnd->m_Mdi.GetCount();if(count==-1)count=0;
  766. if(pos==2 )//&& count)
  767. {
  768. // submenu->DeleteMenu (65280, MF_BYCOMMAND);
  769. // count=submenu->GetMenuItemCount ()-2;
  770. count=submenu->GetMenuItemCount ();
  771. // submenu->DeleteMenu (count-1, MF_BYPOSITION);count--;
  772. }
  773. else
  774. count=submenu->GetMenuItemCount ();
  775. for(int i=0; i<count; i++)
  776. {
  777. // submenu->GetMenuString(submenu->GetMenuItemID(i), text, MF_BYCOMMAND);
  778. submenu->GetMenuString(i, text, MF_BYPOSITION);
  779. if(text.IsEmpty ())
  780. {
  781. if(!(pos==2 && i>11))
  782. pPopup->AppendSeparator();
  783. }
  784. else
  785. {
  786. if(pos==2 && i>10)
  787. {
  788. DWORD id=submenu->GetMenuItemID(i);
  789. if(id>1010)
  790. {
  791. delidarray.Add(id);continue;
  792. }
  793. // if(text.Find("查看历史数据")==-1)
  794. // {
  795. // submenu->DeleteMenu (i, MF_BYPOSITION);
  796. // MessageBox(str);
  797. // continue;
  798. // }
  799. } // CString str;
  800. // str.Format(":%d", submenu->GetMenuItemID(i));
  801. pPopup->AppendODMenu2(0, new CMenuXPText(submenu->GetMenuItemID(i), text, NULL));
  802. if(pos==1 && i==12 && checked)
  803. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  804. else if(pos==1 && i==13 && g_bStaffAchievementShow)
  805. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  806. else if(pos==2 && i==10 && g_bShowOK==0)
  807. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  808. else if(pos==2 && i>10)
  809. {
  810. UINT status=submenu->GetMenuState(submenu->GetMenuItemID(i), MF_BYCOMMAND );
  811. if(status&MF_CHECKED)
  812. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  813. }
  814. else if(pos==0 && i>5)
  815. {
  816. UINT status=submenu->GetMenuState(submenu->GetMenuItemID(i), MF_BYCOMMAND );
  817. if(status&MF_CHECKED)
  818. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  819. }
  820. }
  821. }
  822. for(i=delidarray.GetSize()-1; i>=0; i--)
  823. submenu->DeleteMenu (delidarray.ElementAt(i), MF_BYCOMMAND);
  824. }
  825. rc.left +=5;
  826. pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, rc.left, rc.bottom, g_pMainWnd, 0);
  827. delete pPopup;
  828. }
  829. void MainFrimDlg2::MouseMove()
  830. {
  831. if(m_bLoadMenu)
  832. {
  833. CPoint pt;
  834. ::GetCursorPos (&pt);
  835. ScreenToClient(&pt);
  836. CRect rc=m_rcarray.ElementAt (7);
  837. CRect rc2=m_rcarray.ElementAt (8);
  838. CRect rc3=m_rcarray.ElementAt (9);
  839. CRect rc4=m_rcarray.ElementAt (10);
  840. if(rc.PtInRect (pt) && m_nMenuPos!=0)
  841. {
  842. ShowMenu(0);
  843. }
  844. else if(rc2.PtInRect (pt) && m_nMenuPos!=1)
  845. {
  846. ShowMenu(1);
  847. }
  848. else if(rc3.PtInRect (pt) && m_nMenuPos!=2)
  849. {
  850. ShowMenu(2);
  851. }
  852. else if(rc4.PtInRect (pt) && m_nMenuPos!=3)
  853. {
  854. ShowMenu(3);
  855. }
  856. }
  857. }
  858. extern BOOL g_bDrawLogin;
  859. void MainFrimDlg2::DrawLogin()
  860. {
  861. if(!g_bDrawLogin)
  862. return;
  863. CDC *pDC=GetDC();
  864. Graphics graph(pDC->GetSafeHdc());
  865. CRect rc=m_rcarray.ElementAt (14);rc.right +=60;
  866. RectF layoutRect(rc.left , rc.top, rc.Width (), rc.Height ());
  867. Rect destinationRect(rc.left,rc.top,rc.Width (), rc.Height ());
  868. if(1 )
  869. {
  870. CRect rc;
  871. HWND wnd = ::FindWindow("Shell_TrayWnd", 0);
  872. ::GetWindowRect (wnd, &rc);
  873. int hei=rc.Height ();
  874. rc=CRect(0,0,g_screenwid,g_screenhei-hei);
  875. g_fscalex=(float)g_screenwid/2000.0;
  876. g_fscaley=(float)(g_screenhei-hei)/1400.0;
  877. }
  878. rc.left /=g_fscalex;
  879. rc.right /=g_fscalex;
  880. rc.top /=g_fscaley;
  881. rc.bottom /=g_fscaley;
  882. graph.SetSmoothingMode(SmoothingModeHighQuality);
  883. graph.DrawImage(m_pBk, destinationRect, rc.left , rc.top ,rc.Width (), rc.Height (),UnitPixel);
  884. StringFormat format;
  885. format.SetAlignment(StringAlignmentNear );
  886. SolidBrush *Brush=new SolidBrush(Color(255,255,255,255));
  887. CString str;
  888. if(g_user.bLongin)
  889. str=g_user.name+" (联机) "+g_branchname;
  890. else
  891. str="未登录 "+g_branchname;
  892. if(g_bAllBranch)
  893. {
  894. if(g_user.bLongin)
  895. str=g_user.name+" (联机) 多店汇总";
  896. else
  897. str="未登录 多店汇总";
  898. }
  899. int leng=GetLengthEx(str);
  900. BSTR bstr= str.AllocSysString();
  901. Font *g_TimerFont;
  902. if(g_screenwid<=1024)
  903. g_TimerFont=new Font(L"黑体", 9);
  904. else
  905. g_TimerFont=new Font(L"黑体", 10);
  906. graph.SetTextRenderingHint(TextRenderingHintAntiAlias);
  907. graph.DrawString(
  908. bstr,
  909. leng,
  910. g_TimerFont,
  911. layoutRect,
  912. &format,
  913. Brush);
  914. delete Brush;
  915. delete g_TimerFont;
  916. SysFreeString(bstr);
  917. ReleaseDC(pDC);
  918. }
  919. void MainFrimDlg2::UseRgn(BOOL bUse)
  920. {
  921. if(bUse==0)
  922. {
  923. CRect rc;GetClientRect(rc);
  924. CRgn rgn1, rgn2, rgn3;
  925. rgn1.CreateRectRgn (rc.left , rc.top , rc.right , rc.bottom);
  926. rc=m_rcarray.ElementAt (16);
  927. rgn2.CreateRectRgn (rc.left , rc.top , rc.right , rc.bottom );
  928. rgn1.CombineRgn (&rgn1, &rgn2, RGN_DIFF);
  929. ::SetWindowRgn (m_hWnd, rgn1, 1);
  930. }
  931. else
  932. {
  933. CRect rc;
  934. GetClientRect(rc);
  935. CRgn rgn2;
  936. rgn2.CreateRectRgn (rc.left , rc.top , rc.right , rc.bottom);
  937. ::SetWindowRgn (m_hWnd, rgn2, 1);
  938. }
  939. // ShowBar(bUse);
  940. }
  941. BOOL MainFrimDlg2::IsHasRight(CString rights, CString name)
  942. {
  943. return 1;
  944. CStringArray array;
  945. array.Add (_T("门市流程"));
  946. array.Add(_T("财务管理"));
  947. array.Add(_T("统计查询"));
  948. //array.Add(_T("短信群发"));//Jeff
  949. array.Add(_T("短信管理"));//Jeff
  950. array.Add(_T("会员管理"));
  951. array.Add(_T("礼服管理"));
  952. array.Add(_T("库存管理"));
  953. array.Add(_T("客户管理"));
  954. array.Add(_T("来电精灵"));
  955. array.Add(_T("员工考勤"));
  956. for(int i=0; i<array.GetSize (); i++)
  957. {
  958. if(name==array.ElementAt (i))
  959. {
  960. return atoi(rights.Mid (i,1));
  961. }
  962. }
  963. return 0;
  964. }
  965. void MainFrimDlg2::ShowBar(BOOL bShow)
  966. {
  967. #ifndef BASIC_VERSION
  968. if(g_bShowBar==0 && bShow)return;
  969. if(g_bAllBranch)
  970. {
  971. m_bar.ShowWindow (0);
  972. return;
  973. }
  974. if(bShow)
  975. {
  976. m_bar.InitCtrl(); m_bar.LinkClick("∧");
  977. }
  978. m_bar.ShowWindow (bShow);
  979. #endif
  980. }
  981. BOOL MainFrimDlg2::IsHasRightsHead(CString rights, CString name)
  982. {
  983. if(g_user.account=="admin")return 1;
  984. name="*"+name+";1;";
  985. int pos=rights.Find (name);
  986. if(pos==-1)return 0;
  987. return 1;
  988. }
  989. BOOL MainFrimDlg2::IsHasRightsItem(CString rights, CString head, CString name)
  990. {
  991. if(g_user.account=="admin")return 1;
  992. head="*"+head+";";
  993. int pos=rights.Find (head);
  994. if(pos==-1)return 0;
  995. rights=rights.Right(rights.GetLength()-pos-head.GetLength()-2);
  996. pos=rights.Find("*");
  997. if(pos!=-1)
  998. rights=rights.Left(pos);
  999. if(name=="开单")
  1000. {
  1001. if(rights.Find("预约")!=-1)return 1;
  1002. }
  1003. if(rights.Find(name)!=-1)return 1;
  1004. return 0;
  1005. }
  1006. void MainFrimDlg2::EnableBtns(BOOL bEnable)
  1007. {
  1008. ((MyBmpButton2*)m_picarray.ElementAt (0))->EnableWindow (bEnable);
  1009. ((MyBmpButton2*)m_picarray.ElementAt (1))->EnableWindow (bEnable);
  1010. ((MyBmpButton2*)m_picarray.ElementAt (2))->EnableWindow (bEnable);
  1011. ((MyBmpButton2*)m_picarray.ElementAt (3))->EnableWindow (bEnable);
  1012. ((MyBmpButton2*)m_picarray.ElementAt (4))->EnableWindow (bEnable);
  1013. ((MyBmpButton2*)m_picarray.ElementAt (5))->EnableWindow (bEnable);
  1014. ((MyBmpButton2*)m_picarray.ElementAt (6))->EnableWindow (bEnable);
  1015. ((MyBmpButton2*)m_picarray.ElementAt (0))->ReDraw ();
  1016. ((MyBmpButton2*)m_picarray.ElementAt (1))->ReDraw ();
  1017. ((MyBmpButton2*)m_picarray.ElementAt (2))->ReDraw ();
  1018. ((MyBmpButton2*)m_picarray.ElementAt (3))->ReDraw ();
  1019. ((MyBmpButton2*)m_picarray.ElementAt (4))->ReDraw ();
  1020. ((MyBmpButton2*)m_picarray.ElementAt (5))->ReDraw ();
  1021. ((MyBmpButton2*)m_picarray.ElementAt (6))->ReDraw ();
  1022. }
  1023. void MainFrimDlg2::RefreshOutlookBar2()
  1024. {
  1025. #ifdef BASIC_VERSION
  1026. return;
  1027. #endif
  1028. int count=m_wndOutlookBar.GetFolderCount ();
  1029. while(count--)
  1030. m_wndOutlookBar.RemoveFolder(0);
  1031. int iFolder; // index of the added folder
  1032. int foldercount=0;
  1033. CArray<CStringArray, CStringArray>List1array;
  1034. List1array.SetSize(15,0);
  1035. List1array.ElementAt (0).Add ("分店汇总");
  1036. List1array.ElementAt (0).Add ("订单报表");
  1037. List1array.ElementAt (0).Add ("发片/取件");
  1038. List1array.ElementAt (0).Add ("相片冲印");
  1039. List1array.ElementAt (0).Add ("金卡会员");
  1040. List1array.ElementAt (0).Add ("现金子卡");
  1041. List1array.ElementAt (0).Add ("员工资料");
  1042. List1array.ElementAt (1).Add ("客服中心");
  1043. List1array.ElementAt (1).Add ("摄控安排");
  1044. List1array.ElementAt (1).Add ("选片预约");
  1045. List1array.ElementAt (1).Add ("看样预约");
  1046. List1array.ElementAt (1).Add ("取件预约");
  1047. #ifndef CHILD_VERSION
  1048. List1array.ElementAt (1).Add ("婚庆安排");
  1049. #endif
  1050. List1array.ElementAt (2).Add ("数码中心");
  1051. List1array.ElementAt (2).Add ("拍照");
  1052. List1array.ElementAt (2).Add ("修片");
  1053. List1array.ElementAt (2).Add ("精修");
  1054. List1array.ElementAt (2).Add ("设计");
  1055. List1array.ElementAt (2).Add ("数码安排");
  1056. for(int i=0; i<15; i++)
  1057. {
  1058. while(List1array.ElementAt (i).GetSize ()<20)
  1059. List1array.ElementAt (i).Add ("");
  1060. }
  1061. CString m_rights=g_user.rights2;
  1062. int nItem=0;
  1063. CString str;
  1064. for(int a=0; a<3; a++)
  1065. {
  1066. for(int b=0; b<20; b++)
  1067. {
  1068. str=List1array.ElementAt (a).ElementAt (b);
  1069. if(str.IsEmpty ())break;
  1070. if(b==0)
  1071. {
  1072. if(1)//IsHasRightsHead(m_rights, str))
  1073. {
  1074. iFolder = m_wndOutlookBar.AddFolder(str, foldercount);foldercount++;
  1075. }
  1076. else
  1077. break;
  1078. }
  1079. else
  1080. {
  1081. if(1)//IsHasRightsItem(m_rights, List1array.ElementAt (a).ElementAt (0), str))
  1082. {
  1083. m_wndOutlookBar.InsertItem(iFolder, b, str, b-1, NULL);
  1084. }
  1085. }
  1086. }
  1087. }
  1088. // We want to receive notification messages.
  1089. m_wndOutlookBar.SetOwner(this);
  1090. m_wndOutlookBar.SetSelFolder(0);
  1091. }
  1092. //提成比例
  1093. void MainFrimDlg2::RefreshOutlookBarLYFZ()
  1094. {
  1095. int count=m_wndOutlookBar.GetFolderCount ();
  1096. while(count--)
  1097. m_wndOutlookBar.RemoveFolder(0);
  1098. int iFolder; // index of the added folder
  1099. int foldercount=0;
  1100. g_OutlookBararray.RemoveAll ();
  1101. g_OutlookBararray.SetSize(15,0);
  1102. g_OutlookBararray.ElementAt (foldercount).Add ("客户管理");
  1103. g_OutlookBararray.ElementAt (foldercount).Add ("意向客户");
  1104. g_OutlookBararray.ElementAt (foldercount).Add ("服务记录");
  1105. g_OutlookBararray.ElementAt (foldercount).Add ("服务统计");
  1106. g_OutlookBararray.ElementAt (foldercount).Add ("每日签到");
  1107. g_OutlookBararray.ElementAt (foldercount).Add ("服务费");
  1108. g_OutlookBararray.ElementAt (foldercount).Add ("客户短信");
  1109. g_OutlookBararray.ElementAt (foldercount).Add ("满意度");
  1110. g_OutlookBararray.ElementAt (foldercount).Add ("满意度图表");
  1111. g_OutlookBararray.ElementAt (foldercount).Add ("客户流失");
  1112. g_OutlookBararray.ElementAt (foldercount).Add ("客户来源");
  1113. foldercount++;
  1114. g_OutlookBararray.ElementAt (foldercount).Add ("门市流程");
  1115. g_OutlookBararray.ElementAt (foldercount).Add ("开单");
  1116. g_OutlookBararray.ElementAt (foldercount).Add ("拍照");
  1117. g_OutlookBararray.ElementAt (foldercount).Add ("修片");
  1118. g_OutlookBararray.ElementAt (foldercount).Add ("选片");
  1119. g_OutlookBararray.ElementAt (foldercount).Add ("精修");
  1120. g_OutlookBararray.ElementAt (foldercount).Add ("设计");
  1121. g_OutlookBararray.ElementAt (foldercount).Add ("刻盘");
  1122. g_OutlookBararray.ElementAt (foldercount).Add ("相片冲印");
  1123. g_OutlookBararray.ElementAt (foldercount).Add ("发片/取件");
  1124. g_OutlookBararray.ElementAt (foldercount).Add ("数码安排");
  1125. foldercount++;
  1126. g_OutlookBararray.ElementAt (foldercount).Add ("财务管理");
  1127. g_OutlookBararray.ElementAt (foldercount).Add ("订单收款");
  1128. g_OutlookBararray.ElementAt (foldercount).Add ("其它二销");
  1129. g_OutlookBararray.ElementAt (foldercount).Add ("现金支出");
  1130. g_OutlookBararray.ElementAt (foldercount).Add ("其它收入");
  1131. g_OutlookBararray.ElementAt (foldercount).Add ("提成比例");
  1132. //g_OutlookBararray.ElementAt (foldercount).Add ("员工工作");
  1133. g_OutlookBararray.ElementAt (foldercount).Add ("计件提成"); // Jeff
  1134. g_OutlookBararray.ElementAt (foldercount).Add ("工资管理");
  1135. g_OutlookBararray.ElementAt (foldercount).Add ("员工奖罚");
  1136. foldercount++;
  1137. g_OutlookBararray.ElementAt (foldercount).Add ("统计查询");
  1138. g_OutlookBararray.ElementAt (foldercount).Add ("日财务表");
  1139. g_OutlookBararray.ElementAt (foldercount).Add ("月财务表");
  1140. g_OutlookBararray.ElementAt (foldercount).Add ("年财务表");
  1141. g_OutlookBararray.ElementAt (foldercount).Add ("年财务图表");
  1142. g_OutlookBararray.ElementAt (foldercount).Add ("订单图表");
  1143. g_OutlookBararray.ElementAt (foldercount).Add ("成本核算");
  1144. g_OutlookBararray.ElementAt (foldercount).Add ("工资报表");
  1145. g_OutlookBararray.ElementAt (foldercount).Add ("员工业绩");
  1146. g_OutlookBararray.ElementAt (foldercount).Add ("员工资料");
  1147. g_OutlookBararray.ElementAt (foldercount).Add ("员工奖惩");
  1148. g_OutlookBararray.ElementAt (foldercount).Add ("客户区域");
  1149. foldercount++;
  1150. // g_OutlookBararray.ElementAt (foldercount).Add (" 短信群发 ");
  1151. g_OutlookBararray.ElementAt (foldercount).Add (" 短信管理 ");
  1152. g_OutlookBararray.ElementAt (foldercount).Add ("短信群发");
  1153. g_OutlookBararray.ElementAt (foldercount).Add ("短信发送");
  1154. g_OutlookBararray.ElementAt (foldercount).Add ("流程短信");
  1155. g_OutlookBararray.ElementAt (foldercount).Add ("员工短信");
  1156. g_OutlookBararray.ElementAt (foldercount).Add ("发送记录");
  1157. g_OutlookBararray.ElementAt (foldercount).Add ("短信设置");
  1158. foldercount++;
  1159. g_OutlookBararray.ElementAt (foldercount).Add ("会员管理");
  1160. g_OutlookBararray.ElementAt (foldercount).Add ("金卡会员");
  1161. g_OutlookBararray.ElementAt (foldercount).Add ("现金子卡");
  1162. g_OutlookBararray.ElementAt (foldercount).Add ("金卡图表");
  1163. g_OutlookBararray.ElementAt (foldercount).Add ("积分短信");
  1164. foldercount++;
  1165. g_OutlookBararray.ElementAt (foldercount).Add ("蓝钻会员");
  1166. g_OutlookBararray.ElementAt (foldercount).Add ("转介绍返现");
  1167. g_OutlookBararray.ElementAt (foldercount).Add ("转介绍图表");
  1168. g_OutlookBararray.ElementAt (foldercount).Add ("积分设置");
  1169. foldercount++;
  1170. g_OutlookBararray.ElementAt (foldercount).Add ("库存管理");
  1171. g_OutlookBararray.ElementAt (foldercount).Add ("入库单");
  1172. g_OutlookBararray.ElementAt (foldercount).Add ("出库单");
  1173. g_OutlookBararray.ElementAt (foldercount).Add ("库存查询");
  1174. g_OutlookBararray.ElementAt (foldercount).Add ("商品图表");
  1175. g_OutlookBararray.ElementAt (foldercount).Add ("固定资产管理");
  1176. foldercount++;
  1177. g_OutlookBararray.ElementAt (foldercount).Add ("来电精灵");
  1178. g_OutlookBararray.ElementAt (foldercount).Add ("客户来电");
  1179. g_OutlookBararray.ElementAt (foldercount).Add ("拨出电话");
  1180. g_OutlookBararray.ElementAt (foldercount).Add ("未接来电");
  1181. foldercount++;
  1182. g_OutlookBararray.ElementAt (foldercount).Add ("员工考勤");
  1183. g_OutlookBararray.ElementAt (foldercount).Add ("考勤记录");
  1184. g_OutlookBararray.ElementAt (foldercount).Add ("月统计");
  1185. g_OutlookBararray.ElementAt (foldercount).Add ("时间设置");
  1186. g_OutlookBararray.ElementAt (foldercount).Add ("排班设置");
  1187. BOOL bHospital=0;
  1188. if(g_cominfoarray.GetSize ())
  1189. {
  1190. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
  1191. {
  1192. bHospital=1;
  1193. }
  1194. }
  1195. if(bHospital)
  1196. {
  1197. foldercount++;
  1198. g_OutlookBararray.ElementAt (foldercount).Add ("医院跟踪系统");
  1199. g_OutlookBararray.ElementAt (foldercount).Add ("意向查询");
  1200. g_OutlookBararray.ElementAt (foldercount).Add ("意向单录入");
  1201. g_OutlookBararray.ElementAt (foldercount).Add ("今日提醒");
  1202. g_OutlookBararray.ElementAt (foldercount).Add ("跟踪短信");
  1203. g_OutlookBararray.ElementAt (foldercount).Add ("资料设置");
  1204. }
  1205. for(int i=0; i<15; i++)
  1206. {
  1207. while(g_OutlookBararray.ElementAt (i).GetSize ()<20)
  1208. g_OutlookBararray.ElementAt (i).Add ("");
  1209. }
  1210. CString m_rights=g_user.rights2;
  1211. int nItem=0;
  1212. CString str;
  1213. int itemcount=10;
  1214. if(bHospital)itemcount=11;
  1215. for(int a=0; a<itemcount; a++)
  1216. {
  1217. for(int b=0; b<20; b++)
  1218. {
  1219. str=g_OutlookBararray.ElementAt (a).ElementAt (b);
  1220. if(str.IsEmpty ())break;
  1221. if(b==0)
  1222. {
  1223. if(IsHasRightsHead(m_rights, str))
  1224. {
  1225. iFolder = m_wndOutlookBar.AddFolder(str, foldercount);foldercount++;
  1226. }
  1227. else
  1228. break;
  1229. }
  1230. else
  1231. {
  1232. if(IsHasRightsItem(m_rights, g_OutlookBararray.ElementAt (a).ElementAt (0), str))
  1233. {
  1234. m_wndOutlookBar.InsertItem(iFolder, b, str, b-1, NULL);
  1235. }
  1236. }
  1237. }
  1238. }
  1239. // We want to receive notification messages.
  1240. m_wndOutlookBar.SetOwner(this);
  1241. m_wndOutlookBar.SetSelFolder(0);
  1242. }
  1243. void MainFrimDlg2::RefreshOutlookBar()//初始化侧边栏;
  1244. {
  1245. #ifdef LYFZ_VERSION
  1246. RefreshOutlookBarLYFZ();
  1247. return;
  1248. #endif
  1249. #ifdef BASIC_VERSION
  1250. return;
  1251. #endif
  1252. int count=m_wndOutlookBar.GetFolderCount ();
  1253. while(count--)
  1254. m_wndOutlookBar.RemoveFolder(0);
  1255. int iFolder; // index of the added folder
  1256. int foldercount=0;
  1257. g_OutlookBararray.RemoveAll ();
  1258. g_OutlookBararray.SetSize(15,0);
  1259. g_OutlookBararray.ElementAt (0).Add ("门市流程");
  1260. g_OutlookBararray.ElementAt (0).Add ("开单");
  1261. g_OutlookBararray.ElementAt (0).Add ("拍照");
  1262. g_OutlookBararray.ElementAt (0).Add ("修片");
  1263. g_OutlookBararray.ElementAt (0).Add ("选片");
  1264. g_OutlookBararray.ElementAt (0).Add ("精修");
  1265. g_OutlookBararray.ElementAt (0).Add ("设计");
  1266. g_OutlookBararray.ElementAt (0).Add ("刻盘");
  1267. g_OutlookBararray.ElementAt (0).Add ("相片冲印");
  1268. g_OutlookBararray.ElementAt (0).Add ("发片/取件");
  1269. g_OutlookBararray.ElementAt (0).Add ("数码安排");
  1270. g_OutlookBararray.ElementAt (1).Add ("财务管理");
  1271. g_OutlookBararray.ElementAt (1).Add ("订单收款");
  1272. g_OutlookBararray.ElementAt (1).Add ("其它二销");
  1273. g_OutlookBararray.ElementAt (1).Add ("现金支出");
  1274. g_OutlookBararray.ElementAt (1).Add ("其它收入");
  1275. g_OutlookBararray.ElementAt (1).Add ("提成比例");
  1276. // g_OutlookBararray.ElementAt (1).Add ("员工工作");
  1277. g_OutlookBararray.ElementAt (1).Add ("计件提成"); // Jeff
  1278. g_OutlookBararray.ElementAt (1).Add ("工资管理");
  1279. g_OutlookBararray.ElementAt (1).Add ("员工奖罚");
  1280. g_OutlookBararray.ElementAt (2).Add ("统计查询");
  1281. g_OutlookBararray.ElementAt (2).Add ("日财务表");
  1282. g_OutlookBararray.ElementAt (2).Add ("月财务表");
  1283. g_OutlookBararray.ElementAt (2).Add ("年财务表");
  1284. g_OutlookBararray.ElementAt (2).Add ("年财务图表");
  1285. g_OutlookBararray.ElementAt (2).Add ("订单图表");
  1286. g_OutlookBararray.ElementAt (2).Add ("成本核算");
  1287. g_OutlookBararray.ElementAt (2).Add ("工资报表");
  1288. g_OutlookBararray.ElementAt (2).Add ("员工业绩");
  1289. g_OutlookBararray.ElementAt (2).Add ("员工资料");
  1290. g_OutlookBararray.ElementAt (2).Add ("员工奖惩");
  1291. g_OutlookBararray.ElementAt (2).Add ("客户区域");
  1292. // g_OutlookBararray.ElementAt (3).Add (" 短信群发 "); //// 2014.05.19 Jeff
  1293. g_OutlookBararray.ElementAt (3).Add (" 短信管理 "); //// 2014.05.19 Jeff
  1294. g_OutlookBararray.ElementAt (3).Add ("短信群发");
  1295. g_OutlookBararray.ElementAt (3).Add ("短信发送");
  1296. g_OutlookBararray.ElementAt (3).Add ("流程短信");
  1297. g_OutlookBararray.ElementAt (3).Add ("员工短信");
  1298. g_OutlookBararray.ElementAt (3).Add ("发送记录");
  1299. g_OutlookBararray.ElementAt (3).Add ("短信设置");
  1300. g_OutlookBararray.ElementAt (4).Add ("会员管理");
  1301. g_OutlookBararray.ElementAt (4).Add ("金卡会员");
  1302. g_OutlookBararray.ElementAt (4).Add ("现金子卡");
  1303. g_OutlookBararray.ElementAt (4).Add ("金卡图表");
  1304. g_OutlookBararray.ElementAt (4).Add ("积分短信");
  1305. g_OutlookBararray.ElementAt (4).Add ("蓝钻会员");
  1306. g_OutlookBararray.ElementAt (4).Add ("转介绍返现");
  1307. g_OutlookBararray.ElementAt (4).Add ("转介绍图表");
  1308. g_OutlookBararray.ElementAt (4).Add ("积分设置");
  1309. g_OutlookBararray.ElementAt (5).Add ("礼服管理");
  1310. g_OutlookBararray.ElementAt (5).Add ("礼服录入");
  1311. g_OutlookBararray.ElementAt (5).Add ("礼服查看");
  1312. g_OutlookBararray.ElementAt (5).Add ("礼服出租");
  1313. g_OutlookBararray.ElementAt (5).Add ("撞期预警");
  1314. g_OutlookBararray.ElementAt (5).Add ("礼服图片");
  1315. g_OutlookBararray.ElementAt (6).Add ("库存管理");
  1316. g_OutlookBararray.ElementAt (6).Add ("入库单");
  1317. g_OutlookBararray.ElementAt (6).Add ("出库单");
  1318. g_OutlookBararray.ElementAt (6).Add ("库存查询");
  1319. g_OutlookBararray.ElementAt (6).Add ("商品图表");
  1320. g_OutlookBararray.ElementAt (6).Add ("固定资产管理");
  1321. g_OutlookBararray.ElementAt (7).Add ("客户管理");
  1322. g_OutlookBararray.ElementAt (7).Add ("订单客户");
  1323. g_OutlookBararray.ElementAt (7).Add ("老客户");
  1324. g_OutlookBararray.ElementAt (7).Add ("意向客户");
  1325. g_OutlookBararray.ElementAt (7).Add ("客户流失");
  1326. g_OutlookBararray.ElementAt (7).Add ("客户来源");
  1327. g_OutlookBararray.ElementAt (8).Add ("来电精灵");
  1328. g_OutlookBararray.ElementAt (8).Add ("客户来电");
  1329. g_OutlookBararray.ElementAt (8).Add ("拨出电话");
  1330. g_OutlookBararray.ElementAt (8).Add ("未接来电");
  1331. g_OutlookBararray.ElementAt (9).Add ("员工考勤");
  1332. g_OutlookBararray.ElementAt (9).Add ("考勤记录");
  1333. g_OutlookBararray.ElementAt (9).Add ("月统计");
  1334. g_OutlookBararray.ElementAt (9).Add ("时间设置");
  1335. g_OutlookBararray.ElementAt (9).Add ("排班设置");
  1336. g_OutlookBararray.ElementAt (10).Add ("客户服务");
  1337. g_OutlookBararray.ElementAt (10).Add ("满意度");
  1338. g_OutlookBararray.ElementAt (10).Add ("满意度图表");
  1339. g_OutlookBararray.ElementAt (10).Add ("回复统计");
  1340. #if 1 // 2014.07.08.文件柜
  1341. g_OutlookBararray.ElementAt(11).Add("电子办公");
  1342. g_OutlookBararray.ElementAt(11).Add("文件柜");
  1343. #endif
  1344. BOOL bHospital=0;
  1345. if(g_cominfoarray.GetSize ())
  1346. {
  1347. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
  1348. {
  1349. bHospital=1;
  1350. }
  1351. }
  1352. if(bHospital)
  1353. {
  1354. #if 0
  1355. g_OutlookBararray.ElementAt (11).Add ("医院跟踪系统");
  1356. g_OutlookBararray.ElementAt (11).Add ("意向查询");
  1357. g_OutlookBararray.ElementAt (11).Add ("意向单录入");
  1358. g_OutlookBararray.ElementAt (11).Add ("今日提醒");
  1359. g_OutlookBararray.ElementAt (11).Add ("跟踪短信");
  1360. g_OutlookBararray.ElementAt (11).Add ("资料设置");
  1361. #else
  1362. g_OutlookBararray.ElementAt (12).Add ("医院跟踪系统");
  1363. g_OutlookBararray.ElementAt (12).Add ("意向查询");
  1364. g_OutlookBararray.ElementAt (12).Add ("意向单录入");
  1365. g_OutlookBararray.ElementAt (12).Add ("今日提醒");
  1366. g_OutlookBararray.ElementAt (12).Add ("跟踪短信");
  1367. g_OutlookBararray.ElementAt (12).Add ("资料设置");
  1368. #endif
  1369. }
  1370. for(int i=0; i<15; i++)
  1371. {
  1372. while(g_OutlookBararray.ElementAt (i).GetSize ()<20)
  1373. g_OutlookBararray.ElementAt (i).Add ("");
  1374. }
  1375. CString m_rights=g_user.rights2;
  1376. //printf("Jeff:用户权限=%s\n\n",m_rights);
  1377. int nItem=0;
  1378. CString str;
  1379. //int itemcount=11;
  1380. int itemcount = 12; // 2014.07.08.添加文件柜,基数变化;
  1381. if(bHospital)itemcount++;
  1382. for(int a=0; a<itemcount; a++)
  1383. {
  1384. for(int b=0; b<20; b++)
  1385. {
  1386. str=g_OutlookBararray.ElementAt (a).ElementAt (b);
  1387. if(str.IsEmpty ())break;
  1388. if(b==0)
  1389. {
  1390. if(IsHasRightsHead(m_rights, str))
  1391. {
  1392. iFolder = m_wndOutlookBar.AddFolder(str, foldercount);foldercount++;
  1393. }
  1394. else
  1395. break;
  1396. }
  1397. else
  1398. {
  1399. if(IsHasRightsItem(m_rights, g_OutlookBararray.ElementAt (a).ElementAt (0), str))
  1400. {
  1401. m_wndOutlookBar.InsertItem(iFolder, b, str, b-1, NULL);
  1402. }
  1403. }
  1404. }
  1405. }
  1406. // We want to receive notification messages.
  1407. m_wndOutlookBar.SetOwner(this);
  1408. m_wndOutlookBar.SetSelFolder(0);
  1409. }