MainFrimDlg2.cpp 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564
  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. AfxGetApp()->WriteProfileInt(LYFZVERSION, "redskin", 0);
  209. AfxMessageBox("切换成功,重启软件生效!", MB_ICONINFORMATION);
  210. }
  211. else
  212. {
  213. if (0 == ::PathFileExists(g_mainpath + "\\skin\\10-red.lia"))
  214. {
  215. AfxMessageBox("红色界面包尚未安装,请通知系统管理员!", MB_ICONINFORMATION);
  216. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  217. return;
  218. }
  219. if (AfxMessageBox("确定切换成红色风格界面吗?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
  220. AfxGetApp()->WriteProfileInt(LYFZVERSION, "redskin", 1);
  221. AfxMessageBox("切换成功,重启软件生效!", MB_ICONINFORMATION);
  222. }
  223. break;
  224. }
  225. }
  226. BOOL MainFrimDlg2::PreTransMsg(MSG* pMsg)
  227. {
  228. if (pMsg->message == WM_KEYDOWN)
  229. {
  230. switch (pMsg->wParam)
  231. {
  232. case VK_ESCAPE:
  233. case VK_RETURN:
  234. return 1;
  235. }
  236. }
  237. else if (pMsg->message == WM_PAINT && pMsg->hwnd == this->m_hWnd)
  238. {
  239. SetTimer(1, 100, NULL);
  240. // DrawLogin();
  241. }
  242. else if (pMsg->message == WM_TIMER&& pMsg->hwnd == this->m_hWnd)
  243. {
  244. KillTimer(1);
  245. // LOG4C((LOG_NOTICE,"DrawLogin"));
  246. DrawLogin();
  247. }
  248. else if (pMsg->message == WM_LBUTTONUP)
  249. {
  250. CPoint pt;
  251. GetCursorPos(&pt);
  252. ScreenToClient(&pt);
  253. CRect rc;
  254. rc = m_rcarray.ElementAt(11);
  255. if (rc.PtInRect(pt))
  256. ::SendMessage(g_pMainWnd->GetSafeHwnd(), WM_SYSCOMMAND, SC_MINIMIZE, 0);
  257. rc = m_rcarray.ElementAt(16);
  258. rc.left = rc.right - 115;
  259. rc.top = rc.bottom - 35;
  260. if (rc.PtInRect(pt))
  261. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  262. }
  263. else if (pMsg->message == WM_LBUTTONDBLCLK)
  264. {
  265. CPoint pt;
  266. GetCursorPos(&pt);
  267. ScreenToClient(&pt);
  268. CRect rc;
  269. GetClientRect(rc);
  270. CPoint pt2 = rc.CenterPoint();
  271. rc.left = pt2.x - 20;
  272. rc.right = pt2.x + 20;
  273. rc.top = pt2.y - 10;
  274. rc.bottom = pt2.y + 10;
  275. if (rc.PtInRect(pt) && g_pMainWnd->IsShiftDown() && g_pMainWnd->IsCtrlDown())
  276. {
  277. MessageBox("版权所有:惠州市利亚方舟科技有限公司\r\n电话:0752-2398865\r\n网址:www.lyfz.net");
  278. }
  279. }
  280. return g_pMainWnd->PreTranslateMessage(pMsg);
  281. }
  282. /*
  283. typedef struct gifImage{
  284. WORD lWidth;
  285. WORD lHeight;
  286. WORD width;
  287. WORD height;
  288. struct flag{
  289. BYTE d:3;
  290. BYTE c:1;
  291. BYTE b:3;
  292. BYTE a:1;
  293. }Flag;
  294. }GifImage,*PGifImage;
  295. #include <math.h>
  296. static UINT GifThread(LPVOID gifDC)
  297. {
  298. CDC* pdc = (CDC*)gifDC;
  299. HINSTANCE handle = ::AfxGetResourceHandle();
  300. HRSRC hrsrc = ::FindResource(handle,MAKEINTRESOURCE(IDR_GIF1),"GIF");
  301. DWORD word = ::SizeofResource(handle,hrsrc);
  302. BYTE* lpBy = (BYTE*)LoadResource(handle,hrsrc);
  303. BYTE* pByte[20];
  304. DWORD nu[20];
  305. int num = 0;
  306. DWORD firstLocation = 0;
  307. for(DWORD j=0;j<word;j++)
  308. {
  309. if(lpBy[j]==0x2c)
  310. {
  311. if(lpBy[j-1]==0x00)
  312. {
  313. if(num==0)
  314. {
  315. firstLocation = j;
  316. }
  317. PGifImage nowImage = (PGifImage)&lpBy[j+1];
  318. if(nowImage->Flag.a==0)
  319. {
  320. DWORD number = 1+sizeof(GifImage);
  321. while(lpBy[j+number]!=0)
  322. {
  323. number = number+(DWORD)lpBy[j+number]+1;
  324. }
  325. number++;
  326. pByte[num] = new BYTE[number];
  327. for(DWORD n=0;n<number;n++)
  328. {
  329. *(BYTE*)(pByte[num]+n) = lpBy[j+n];
  330. }
  331. nu[num] = number;
  332. j = j+number-1;
  333. num++;
  334. }
  335. else
  336. {
  337. int number = 1+sizeof(GifImage)+1+3*(int)floor(pow(2,nowImage->Flag.d));
  338. while(lpBy[j+number]!=0)
  339. {
  340. number = number+lpBy[j+number];
  341. }
  342. pByte[num] = new BYTE[number];
  343. for(int n=0;n<number;n++)
  344. {
  345. *(BYTE*)(pByte[num]+n) = lpBy[j+n];
  346. }
  347. nu[num] = number;
  348. j = j+number-1;
  349. num++;
  350. }
  351. }
  352. }
  353. }
  354. int i = 1;
  355. while(i)
  356. {
  357. for(int m=0;m<num;m++)
  358. {
  359. CBrush brush(RGB(255,255,255));
  360. pdc->FillRect(CRect(0,0,500,500),&brush);
  361. DWORD DDD;
  362. VirtualProtect(lpBy,word,PAGE_READWRITE,&DDD);
  363. for(DWORD n=0;n<nu[m];n++)
  364. {
  365. lpBy[firstLocation+n] = *(BYTE*)(pByte[m]+n);
  366. }
  367. VirtualProtect(lpBy,word,DDD,NULL);
  368. CMemFile file(lpBy,word);
  369. CArchive ar(&file,CArchive::load|CArchive::bNoFlushOnDelete);
  370. CArchiveStream arcstream(&ar);
  371. CComQIPtr<IPicture> m_picture;
  372. HRESULT hr = OleLoadPicture((LPSTREAM)&arcstream,0,false,IID_IPicture,(void**)&m_picture);
  373. long a,b;
  374. m_picture->get_Width(&a);
  375. m_picture->get_Height(&b);
  376. CSize sz(a,b);
  377. pdc->HIMETRICtoDP(&sz);
  378. CRect rect;
  379. m_picture->Render(*pdc,0,0,sz.cx,sz.cy,0,b,a,-b,&rect);
  380. Sleep(100);
  381. }
  382. }
  383. return 1;
  384. }
  385. CDC* m_gifDC=NULL;*/
  386. void MainFrimDlg2::Init2()
  387. {
  388. CRect rc = m_rcarray.ElementAt(15);
  389. // rc.top-=5;
  390. // rc.bottom-=7;
  391. if (!m_wndOutlookBar.Create(WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, rc, this, 0, OBS_XT_DEFAULT))
  392. {
  393. TRACE0("Failed to create outlook bar.");
  394. return;
  395. }
  396. // Set the background and text color of the outlook bar.
  397. if (g_bRedSkin)
  398. m_wndOutlookBar.SetBackColor(RGB(112, 29, 55));
  399. else
  400. m_wndOutlookBar.SetBackColor(RGB(70, 70, 70));
  401. m_wndOutlookBar.SetTextColor(RGB(0xff, 0xff, 0xff));
  402. // Add items to the outlook bar.
  403. InitializeOutlookBar();
  404. // CDC* pdc = GetDC();
  405. // m_gifDC = new CDC;
  406. // m_gifDC->Attach(pdc->GetSafeHdc());
  407. // AfxBeginThread(GifThread,(LPVOID)m_gifDC);
  408. }
  409. static UINT nIcons[] =
  410. {
  411. IDI_ICON1, IDI_ICON3, IDI_ICON4, IDI_ICON7,
  412. IDI_ICON8, IDI_ICON2, IDI_ICON11, IDI_ICON6,
  413. IDI_ICON9, IDI_ICON10, IDI_ICON5
  414. };
  415. // 初始化侧边栏;
  416. void MainFrimDlg2::InitializeOutlookBar()
  417. {
  418. // Create the image lists used by the outlook bar.
  419. m_ImageSmall.Create(16, 16, ILC_COLOR16 | ILC_MASK, 2, 1);
  420. m_ImageLarge.Create(32, 32, ILC_COLOR16 | ILC_MASK, 2, 1);
  421. // initiailize the image lists.
  422. for (int i = 0; i < 11; ++i)
  423. {
  424. HICON hIcon = AfxGetApp()->LoadIcon(nIcons[i]);
  425. ASSERT(hIcon);
  426. m_ImageSmall.Add(hIcon);
  427. m_ImageLarge.Add(hIcon);
  428. }
  429. int iFolder; // index of the added folder
  430. /* CString rights=AfxGetApp()->GetProfileString (LYFZVERSION, "hidewindow", "");
  431. if(rights.IsEmpty ())rights="111111111111111";
  432. BOOL bHide=AfxGetApp()->GetProfileInt (LYFZVERSION, "hidewindow2", 0);
  433. */
  434. CString rights;
  435. int foldercount = 0;
  436. // set the image lists for the outlook bar.
  437. m_wndOutlookBar.SetImageList(&m_ImageLarge, OBS_XT_LARGEICON);
  438. m_wndOutlookBar.SetImageList(&m_ImageSmall, OBS_XT_SMALLICON);
  439. #ifdef BASIC_VERSION
  440. if(IsHasRight(rights,"门市流程"))
  441. {
  442. // Add the first folder to the outlook bar.
  443. iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), foldercount);foldercount++;
  444. // Add items to the folder, syntax is folder, index, text, image, and item data.
  445. m_wndOutlookBar.InsertItem(iFolder, 1, _T("开单"), 0, NULL);
  446. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拍照"), 1, NULL);
  447. m_wndOutlookBar.InsertItem(iFolder, 3, _T("修片"), 2, NULL);
  448. m_wndOutlookBar.InsertItem(iFolder, 4, _T("选片"), 3, NULL);
  449. m_wndOutlookBar.InsertItem(iFolder, 5, _T("精修"), 4, NULL);
  450. m_wndOutlookBar.InsertItem(iFolder, 6, _T("设计"), 5, NULL);
  451. m_wndOutlookBar.InsertItem(iFolder, 7, _T("刻盘"), 6, NULL);
  452. m_wndOutlookBar.InsertItem(iFolder, 8, _T("发片/取件"), 7, NULL);
  453. m_wndOutlookBar.InsertItem(iFolder, 9, _T("数码安排"), 8, NULL);
  454. }
  455. if(IsHasRight(rights,"财务管理"))
  456. {
  457. // Add the second folder to the outlook bar.
  458. iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), foldercount);foldercount++;
  459. // Add items to the folder, syntax is folder, index, text, image, and item data.
  460. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单收款"), 0, NULL);
  461. m_wndOutlookBar.InsertItem(iFolder, 2, _T("现金支出"), 1, NULL);
  462. m_wndOutlookBar.InsertItem(iFolder, 3, _T("其它收入"), 2, NULL);
  463. m_wndOutlookBar.InsertItem(iFolder, 4, _T("其它二销"), 3, NULL);
  464. // m_wndOutlookBar.InsertItem(iFolder, 5, _T("员工奖罚"), 4, NULL);
  465. // m_wndOutlookBar.InsertItem(iFolder, 6, _T("日财务表"), 5, NULL);
  466. // m_wndOutlookBar.InsertItem(iFolder, 7, _T("工资管理"), 6, NULL);
  467. m_wndOutlookBar.InsertItem(iFolder, 5, _T("客人付款"), 6, NULL);
  468. }
  469. //if(IsHasRight(rights,"短信群发"))
  470. if(IsHasRight(rights,"短信管理"))
  471. {
  472. //iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), foldercount);foldercount++;
  473. iFolder = m_wndOutlookBar.AddFolder(_T("短信管理"), foldercount);foldercount++;
  474. // Add items to the folder, syntax is folder, index, text, image, and item data.
  475. m_wndOutlookBar.InsertItem(iFolder, 1, _T("短信群发"), 0, NULL);
  476. m_wndOutlookBar.InsertItem(iFolder, 2, _T("短信发送"), 1, NULL);
  477. m_wndOutlookBar.InsertItem(iFolder, 3, _T("流程短信"), 2, NULL);
  478. m_wndOutlookBar.InsertItem(iFolder, 4, _T("员工短信"), 3, NULL);
  479. m_wndOutlookBar.InsertItem(iFolder, 5, _T("发送记录"), 4, NULL);
  480. m_wndOutlookBar.InsertItem(iFolder, 6, _T("短信设置"), 5, NULL);
  481. }
  482. #ifdef BASIC_ADDPHONE
  483. if(IsHasRight(rights,"客户管理"))
  484. {
  485. iFolder = m_wndOutlookBar.AddFolder(_T("客户管理"), foldercount);foldercount++;
  486. // Add items to the folder, syntax is folder, index, text, image, and item data.
  487. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单客户"), 0, NULL);
  488. m_wndOutlookBar.InsertItem(iFolder, 2, _T("老客户"), 1, NULL);
  489. m_wndOutlookBar.InsertItem(iFolder, 3, _T("意向客户"), 2, NULL);
  490. m_wndOutlookBar.InsertItem(iFolder, 4, _T("客户流失"), 3, NULL);
  491. m_wndOutlookBar.InsertItem(iFolder, 5, _T("客户来源"), 4, NULL);
  492. }
  493. #endif
  494. #ifdef BASIC_ADDDRESS
  495. if(IsHasRight(rights,"礼服管理"))
  496. {
  497. iFolder = m_wndOutlookBar.AddFolder(_T("礼服管理"), foldercount);foldercount++;
  498. // Add items to the folder, syntax is folder, index, text, image, and item data.
  499. m_wndOutlookBar.InsertItem(iFolder, 1, _T("礼服录入"), 0, NULL);
  500. m_wndOutlookBar.InsertItem(iFolder, 2, _T("礼服查看"), 1, NULL);
  501. m_wndOutlookBar.InsertItem(iFolder, 3, _T("撞期预警"), 2, NULL);
  502. m_wndOutlookBar.InsertItem(iFolder, 4, _T("图片欣赏"), 3, NULL);
  503. m_wndOutlookBar.InsertItem(iFolder, 5, _T("礼服出租"), 4, NULL);
  504. }
  505. #endif
  506. if(IsHasRight(rights,"来电精灵"))
  507. {
  508. iFolder = m_wndOutlookBar.AddFolder(_T("来电精灵"), foldercount);foldercount++;
  509. // Add items to the folder, syntax is folder, index, text, image, and item data.
  510. m_wndOutlookBar.InsertItem(iFolder, 1, _T("客户来电"), 0, NULL);
  511. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拨出电话"), 1, NULL);
  512. m_wndOutlookBar.InsertItem(iFolder, 3, _T("未接来电"), 2, NULL);
  513. }
  514. #ifdef BASIC_ADDMEMBER
  515. if(IsHasRight(rights,"会员管理"))
  516. {
  517. iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), foldercount);foldercount++;
  518. // Add items to the folder, syntax is folder, index, text, image, and item data.
  519. m_wndOutlookBar.InsertItem(iFolder, 1, _T("金卡会员"), 0, NULL);
  520. m_wndOutlookBar.InsertItem(iFolder, 2, _T("转介绍积分"), 1, NULL);
  521. m_wndOutlookBar.InsertItem(iFolder, 3, _T("转介绍图表"), 2, NULL);
  522. m_wndOutlookBar.InsertItem(iFolder, 4, _T("蓝钻会员"), 3, NULL);
  523. m_wndOutlookBar.InsertItem(iFolder, 4, _T("转介绍返现"), 4, NULL);
  524. m_wndOutlookBar.InsertItem(iFolder, 5, _T("转介绍图表2"), 5, NULL);
  525. m_wndOutlookBar.InsertItem(iFolder, 6, _T("积分设置"),6, NULL);
  526. }
  527. #endif
  528. #else
  529. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  530. RefreshOutlookBar();
  531. #endif
  532. }
  533. /*
  534. void MainFrimDlg2::InitializeOutlookBar()
  535. {
  536. // Create the image lists used by the outlook bar.
  537. m_ImageSmall.Create (16, 16, ILC_COLOR16|ILC_MASK, 2, 1);
  538. m_ImageLarge.Create (32, 32, ILC_COLOR16|ILC_MASK, 2, 1);
  539. // initiailize the image lists.
  540. for (int i = 0; i < 11; ++i)
  541. {
  542. HICON hIcon = AfxGetApp()->LoadIcon(nIcons[i]);
  543. ASSERT(hIcon);
  544. m_ImageSmall.Add(hIcon);
  545. m_ImageLarge.Add(hIcon);
  546. }
  547. int iFolder; // index of the added folder
  548. // set the image lists for the outlook bar.
  549. m_wndOutlookBar.SetImageList(&m_ImageLarge, OBS_XT_LARGEICON);
  550. m_wndOutlookBar.SetImageList(&m_ImageSmall, OBS_XT_SMALLICON);
  551. #ifdef BASIC_VERSION
  552. // Add the first folder to the outlook bar.
  553. iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), 0);
  554. // Add items to the folder, syntax is folder, index, text, image, and item data.
  555. m_wndOutlookBar.InsertItem(iFolder, 1, _T("开单"), 0, NULL);
  556. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拍照"), 1, NULL);
  557. m_wndOutlookBar.InsertItem(iFolder, 3, _T("修片"), 2, NULL);
  558. m_wndOutlookBar.InsertItem(iFolder, 4, _T("选片"), 3, NULL);
  559. m_wndOutlookBar.InsertItem(iFolder, 5, _T("精修"), 4, NULL);
  560. m_wndOutlookBar.InsertItem(iFolder, 6, _T("设计"), 5, NULL);
  561. m_wndOutlookBar.InsertItem(iFolder, 7, _T("刻盘"), 6, NULL);
  562. m_wndOutlookBar.InsertItem(iFolder, 8, _T("发片/取件"), 7, NULL);
  563. m_wndOutlookBar.InsertItem(iFolder, 9, _T("数码安排"), 8, NULL);
  564. // Add the second folder to the outlook bar.
  565. iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), 1);
  566. // Add items to the folder, syntax is folder, index, text, image, and item data.
  567. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单收款"), 0, NULL);
  568. m_wndOutlookBar.InsertItem(iFolder, 2, _T("现金支出"), 1, NULL);
  569. m_wndOutlookBar.InsertItem(iFolder, 3, _T("其它收入"), 2, NULL);
  570. m_wndOutlookBar.InsertItem(iFolder, 4, _T("其它二销"), 3, NULL);
  571. // m_wndOutlookBar.InsertItem(iFolder, 5, _T("员工奖罚"), 4, NULL);
  572. // m_wndOutlookBar.InsertItem(iFolder, 6, _T("日财务表"), 5, NULL);
  573. // m_wndOutlookBar.InsertItem(iFolder, 7, _T("工资管理"), 6, NULL);
  574. m_wndOutlookBar.InsertItem(iFolder, 5, _T("客人付款"), 6, NULL);
  575. iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), 2);
  576. // Add items to the folder, syntax is folder, index, text, image, and item data.
  577. m_wndOutlookBar.InsertItem(iFolder, 1, _T("短信群发"), 0, NULL);
  578. m_wndOutlookBar.InsertItem(iFolder, 2, _T("短信发送"), 1, NULL);
  579. m_wndOutlookBar.InsertItem(iFolder, 3, _T("流程短信"), 2, NULL);
  580. m_wndOutlookBar.InsertItem(iFolder, 4, _T("员工短信"), 3, NULL);
  581. m_wndOutlookBar.InsertItem(iFolder, 5, _T("发送记录"), 4, NULL);
  582. m_wndOutlookBar.InsertItem(iFolder, 6, _T("短信设置"), 5, NULL);
  583. #ifdef BASIC_ADDMEMBER
  584. iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), 3);
  585. // Add items to the folder, syntax is folder, index, text, image, and item data.
  586. m_wndOutlookBar.InsertItem(iFolder, 1, _T("金卡会员"), 0, NULL);
  587. m_wndOutlookBar.InsertItem(iFolder, 2, _T("转介绍积分"), 1, NULL);
  588. m_wndOutlookBar.InsertItem(iFolder, 3, _T("转介绍图表"), 2, NULL);
  589. m_wndOutlookBar.InsertItem(iFolder, 4, _T("蓝钻会员"), 3, NULL);
  590. m_wndOutlookBar.InsertItem(iFolder, 4, _T("转介绍返现"), 4, NULL);
  591. m_wndOutlookBar.InsertItem(iFolder, 5, _T("转介绍图表2"), 5, NULL);
  592. m_wndOutlookBar.InsertItem(iFolder, 6, _T("积分设置"),6, NULL);
  593. #endif
  594. #else
  595. // Add the first folder to the outlook bar.
  596. iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), 0);
  597. // Add items to the folder, syntax is folder, index, text, image, and item data.
  598. m_wndOutlookBar.InsertItem(iFolder, 1, _T("开单"), 0, NULL);
  599. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拍照"), 1, NULL);
  600. m_wndOutlookBar.InsertItem(iFolder, 3, _T("修片"), 2, NULL);
  601. m_wndOutlookBar.InsertItem(iFolder, 4, _T("选片"), 3, NULL);
  602. m_wndOutlookBar.InsertItem(iFolder, 5, _T("精修"), 4, NULL);
  603. m_wndOutlookBar.InsertItem(iFolder, 6, _T("设计"), 5, NULL);
  604. m_wndOutlookBar.InsertItem(iFolder, 7, _T("刻盘"), 6, NULL);
  605. m_wndOutlookBar.InsertItem(iFolder, 8, _T("发片/取件"), 7, NULL);
  606. m_wndOutlookBar.InsertItem(iFolder, 9, _T("数码安排"), 8, NULL);
  607. // Add the second folder to the outlook bar.
  608. iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), 1);
  609. // Add items to the folder, syntax is folder, index, text, image, and item data.
  610. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单收款"), 0, NULL);
  611. m_wndOutlookBar.InsertItem(iFolder, 2, _T("现金支出"), 1, NULL);
  612. m_wndOutlookBar.InsertItem(iFolder, 3, _T("其它收入"), 2, NULL);
  613. m_wndOutlookBar.InsertItem(iFolder, 4, _T("其它二销"), 3, NULL);
  614. m_wndOutlookBar.InsertItem(iFolder, 5, _T("员工奖罚"), 4, NULL);
  615. m_wndOutlookBar.InsertItem(iFolder, 6, _T("日财务表"), 5, NULL);
  616. m_wndOutlookBar.InsertItem(iFolder, 7, _T("工资管理"), 6, NULL);
  617. m_wndOutlookBar.InsertItem(iFolder, 8, _T("客人付款"), 7, NULL);
  618. iFolder = m_wndOutlookBar.AddFolder(_T("统计查询"), 2);
  619. // Add items to the folder, syntax is folder, index, text, image, and item data.
  620. m_wndOutlookBar.InsertItem(iFolder, 1, _T("日财务表"), 0, NULL);
  621. m_wndOutlookBar.InsertItem(iFolder, 2, _T("月财务表"), 1, NULL);
  622. m_wndOutlookBar.InsertItem(iFolder, 3, _T("年财务表"), 2, NULL);
  623. m_wndOutlookBar.InsertItem(iFolder, 4, _T("年财务图表"), 3, NULL);
  624. m_wndOutlookBar.InsertItem(iFolder, 5, _T("工资报表"), 4, NULL);
  625. m_wndOutlookBar.InsertItem(iFolder, 6, _T("员工业绩"), 5, NULL);
  626. m_wndOutlookBar.InsertItem(iFolder, 7, _T("员工资料"), 6, NULL);
  627. m_wndOutlookBar.InsertItem(iFolder, 8, _T("员工奖惩"), 7, NULL);
  628. m_wndOutlookBar.InsertItem(iFolder, 9, _T("客户区域"), 8, NULL);
  629. iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), 3);
  630. // Add items to the folder, syntax is folder, index, text, image, and item data.
  631. m_wndOutlookBar.InsertItem(iFolder, 1, _T("短信群发"), 0, NULL);
  632. m_wndOutlookBar.InsertItem(iFolder, 2, _T("短信发送"), 1, NULL);
  633. m_wndOutlookBar.InsertItem(iFolder, 3, _T("流程短信"), 2, NULL);
  634. m_wndOutlookBar.InsertItem(iFolder, 4, _T("员工短信"), 3, NULL);
  635. m_wndOutlookBar.InsertItem(iFolder, 5, _T("发送记录"), 4, NULL);
  636. m_wndOutlookBar.InsertItem(iFolder, 6, _T("短信设置"), 5, NULL);
  637. iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), 4);
  638. // Add items to the folder, syntax is folder, index, text, image, and item data.
  639. m_wndOutlookBar.InsertItem(iFolder, 1, _T("金卡会员"), 0, NULL);
  640. m_wndOutlookBar.InsertItem(iFolder, 2, _T("转介绍积分"), 1, NULL);
  641. m_wndOutlookBar.InsertItem(iFolder, 3, _T("转介绍图表"), 2, NULL);
  642. m_wndOutlookBar.InsertItem(iFolder, 4, _T("蓝钻会员"), 3, NULL);
  643. m_wndOutlookBar.InsertItem(iFolder, 4, _T("转介绍返现"), 4, NULL);
  644. m_wndOutlookBar.InsertItem(iFolder, 5, _T("转介绍图表2"), 5, NULL);
  645. m_wndOutlookBar.InsertItem(iFolder, 6, _T("积分设置"),6, NULL);
  646. iFolder = m_wndOutlookBar.AddFolder(_T("礼服管理"), 5);
  647. // Add items to the folder, syntax is folder, index, text, image, and item data.
  648. m_wndOutlookBar.InsertItem(iFolder, 1, _T("礼服录入"), 0, NULL);
  649. m_wndOutlookBar.InsertItem(iFolder, 2, _T("礼服查看"), 1, NULL);
  650. m_wndOutlookBar.InsertItem(iFolder, 3, _T("图片欣赏"), 2, NULL);
  651. m_wndOutlookBar.InsertItem(iFolder, 4, _T("礼服出租"), 3, NULL);
  652. iFolder = m_wndOutlookBar.AddFolder(_T("库存管理"), 6);
  653. // Add items to the folder, syntax is folder, index, text, image, and item data.
  654. m_wndOutlookBar.InsertItem(iFolder, 1, _T("商品类别设置"), 0, NULL);
  655. m_wndOutlookBar.InsertItem(iFolder, 2, _T("商品名称设置"), 1, NULL);
  656. m_wndOutlookBar.InsertItem(iFolder, 3, _T("入库单"), 2, NULL);
  657. m_wndOutlookBar.InsertItem(iFolder, 4, _T("出库单"), 3, NULL);
  658. m_wndOutlookBar.InsertItem(iFolder, 5, _T("库存查询"), 4, NULL);
  659. m_wndOutlookBar.InsertItem(iFolder, 6, _T("商品图表"), 5, NULL);
  660. iFolder = m_wndOutlookBar.AddFolder(_T("客户管理"), 7);
  661. // Add items to the folder, syntax is folder, index, text, image, and item data.
  662. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单客户"), 0, NULL);
  663. m_wndOutlookBar.InsertItem(iFolder, 2, _T("意向客户"), 1, NULL);
  664. m_wndOutlookBar.InsertItem(iFolder, 3, _T("客户流失"), 2, NULL);
  665. m_wndOutlookBar.InsertItem(iFolder, 4, _T("客户来源"), 3, NULL);
  666. iFolder = m_wndOutlookBar.AddFolder(_T("来电精灵"), 8);
  667. // Add items to the folder, syntax is folder, index, text, image, and item data.
  668. m_wndOutlookBar.InsertItem(iFolder, 1, _T("客户来电"), 0, NULL);
  669. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拨出电话"), 1, NULL);
  670. m_wndOutlookBar.InsertItem(iFolder, 3, _T("未接来电"), 2, NULL);
  671. #ifdef ADD_LOGIN
  672. iFolder = m_wndOutlookBar.AddFolder(_T("员工考勤"), 9);
  673. // Add items to the folder, syntax is folder, index, text, image, and item data.
  674. m_wndOutlookBar.InsertItem(iFolder, 1, _T("考勤记录"), 0, NULL);
  675. m_wndOutlookBar.InsertItem(iFolder, 2, _T("时间设置"), 1, NULL);
  676. m_wndOutlookBar.InsertItem(iFolder, 3, _T("排班设置"), 2, NULL);
  677. #endif
  678. #endif
  679. // Add the tree control to the outlook bar.
  680. //xu iFolder = m_wndOutlookBar.AddFolderBar(_T("Tree Control"), &m_wndTreeCtrl );
  681. // Set the default font used by the outlook bar.
  682. //xu m_wndOutlookBar.SetFontX(&xtAfxData.font);
  683. // We want to receive notification messages.
  684. m_wndOutlookBar.SetOwner(this);
  685. // Select the first folder in the bar.
  686. m_wndOutlookBar.SetSelFolder(0);
  687. }
  688. */
  689. LRESULT MainFrimDlg2::OnOutbarNotify(WPARAM wParam, LPARAM lParam)
  690. {
  691. int nBarAction = (int)wParam;
  692. // Cast the lParam to a XT_OUTBAR_INFO* struct pointer.
  693. XT_OUTBAR_INFO* pOBInfo = (XT_OUTBAR_INFO*)lParam;
  694. ASSERT(pOBInfo);
  695. switch (nBarAction)
  696. {
  697. case OBN_XT_ITEMCLICK:
  698. {
  699. CString strMsg = pOBInfo->lpszText;
  700. g_pMainWnd->OnOutbarNotify(strMsg);
  701. // AfxMessageBox(strMsg);
  702. // TRACE2( "Item selected: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  703. }
  704. break;
  705. /* case OBN_XT_FOLDERCHANGE:
  706. TRACE2( "Folder selected: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  707. break;
  708. case OBN_XT_ONLABELENDEDIT:
  709. TRACE2( "Item edited: %d, New name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  710. break;
  711. case OBN_XT_ONGROUPENDEDIT:
  712. TRACE2( "Folder edited: %d, New name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  713. break;
  714. case OBN_XT_DRAGITEM:
  715. TRACE3( "Dragging From: %d, To: %d, Name: %s.\n", pOBInfo->nDragFrom, pOBInfo->nDragTo, pOBInfo->lpszText);
  716. break;
  717. case OBN_XT_ITEMHOVER:
  718. TRACE2( "Hovering Item: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  719. break;
  720. case OBN_XT_DELETEITEM:
  721. if (!m_bDestroy && AfxMessageBox(_T("Are you sure you want to remove this folder shortcut?"),
  722. MB_ICONWARNING|MB_YESNO) == IDNO)
  723. {
  724. // The user selected No, return FALSE to abort the action.
  725. return FALSE;
  726. }
  727. TRACE2( "Item deleted: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  728. break;
  729. case OBN_XT_DELETEFOLDER:
  730. if (!m_bDestroy && AfxMessageBox(_T("Are you sure you want to remove the specified folder?"),
  731. MB_ICONWARNING|MB_YESNO) == IDNO)
  732. {
  733. // The user selected No, return FALSE to abort the action.
  734. return FALSE;
  735. }
  736. TRACE2( "Folder deleted: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  737. break;*/
  738. }
  739. return TRUE;
  740. }
  741. void MainFrimDlg2::SetSelFolder(int pos)
  742. {
  743. m_wndOutlookBar.SetSelFolder(pos);
  744. }
  745. void MainFrimDlg2::ShowMenu(int pos)
  746. {
  747. printf("\t\t显示菜单,第[%d]个菜单\n", pos + 1);
  748. m_bLoadMenu = 1;
  749. m_nMenuPos = pos;
  750. CRect rc = m_rcarray.ElementAt(7 + pos);
  751. printf("\t\t菜单left:%d, top:%d, rigth:%d, bottom:%d width:%d, height:%d \n", rc.left, rc.top, rc.right, rc.bottom, rc.Width(), rc.Height());
  752. CMenuXP *pPopup;
  753. pPopup = new CMenuXP;
  754. pPopup->CYBUTTONMARGIN = 3;
  755. pPopup->CreatePopupMenu();
  756. pPopup->SetMenuStyle(CMenuXP::STYLE_XP);
  757. CString text;
  758. {
  759. CMenu *pMenu = g_pMainWnd->GetMenu();
  760. CMenu* submenu = pMenu->GetSubMenu(pos);
  761. BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status", 0);
  762. CArray<DWORD, DWORD>delidarray;
  763. int count = g_pMainWnd->m_Mdi.GetCount(); if (count == -1)count = 0;
  764. if (pos == 2)//&& count)
  765. {
  766. // submenu->DeleteMenu (65280, MF_BYCOMMAND);
  767. // count=submenu->GetMenuItemCount ()-2;
  768. count = submenu->GetMenuItemCount();
  769. // submenu->DeleteMenu (count-1, MF_BYPOSITION);count--;
  770. }
  771. else
  772. count = submenu->GetMenuItemCount();
  773. int i = 0;
  774. for (i = 0; i < count; i++)
  775. {
  776. // submenu->GetMenuString(submenu->GetMenuItemID(i), text, MF_BYCOMMAND);
  777. submenu->GetMenuString(i, text, MF_BYPOSITION);
  778. if (text.IsEmpty())
  779. {
  780. if (!(pos == 2 && i > 11))
  781. pPopup->AppendSeparator();
  782. }
  783. else
  784. {
  785. if (pos == 2 && i > 10)
  786. {
  787. DWORD id = submenu->GetMenuItemID(i);
  788. if (id > 1010)
  789. {
  790. delidarray.Add(id); continue;
  791. }
  792. // if(text.Find("查看历史数据")==-1)
  793. // {
  794. // submenu->DeleteMenu (i, MF_BYPOSITION);
  795. // MessageBox(str);
  796. // continue;
  797. // }
  798. } // CString str;
  799. // str.Format(":%d", submenu->GetMenuItemID(i));
  800. pPopup->AppendODMenu2(0, new CMenuXPText(submenu->GetMenuItemID(i), text, NULL));
  801. if (pos == 1 && i == 12 && checked)
  802. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  803. else if (pos == 1 && i == 13 && g_bStaffAchievementShow)
  804. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  805. else if (pos == 2 && i == 10 && g_bShowOK == 0)
  806. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  807. else if (pos == 2 && i > 10)
  808. {
  809. UINT status = submenu->GetMenuState(submenu->GetMenuItemID(i), MF_BYCOMMAND);
  810. if (status&MF_CHECKED)
  811. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  812. }
  813. else if (pos == 0 && i > 5)
  814. {
  815. UINT status = submenu->GetMenuState(submenu->GetMenuItemID(i), MF_BYCOMMAND);
  816. if (status&MF_CHECKED)
  817. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  818. }
  819. }
  820. }
  821. for (i = delidarray.GetSize() - 1; i >= 0; i--)
  822. submenu->DeleteMenu(delidarray.ElementAt(i), MF_BYCOMMAND);
  823. }
  824. rc.left += 5;
  825. pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, rc.left, rc.bottom, g_pMainWnd, 0);
  826. delete pPopup;
  827. }
  828. void MainFrimDlg2::MouseMove()
  829. {
  830. if (m_bLoadMenu)
  831. {
  832. CPoint pt;
  833. ::GetCursorPos(&pt);
  834. ScreenToClient(&pt);
  835. CRect rc = m_rcarray.ElementAt(7);
  836. CRect rc2 = m_rcarray.ElementAt(8);
  837. CRect rc3 = m_rcarray.ElementAt(9);
  838. CRect rc4 = m_rcarray.ElementAt(10);
  839. if (rc.PtInRect(pt) && m_nMenuPos != 0)
  840. {
  841. ShowMenu(0);
  842. }
  843. else if (rc2.PtInRect(pt) && m_nMenuPos != 1)
  844. {
  845. ShowMenu(1);
  846. }
  847. else if (rc3.PtInRect(pt) && m_nMenuPos != 2)
  848. {
  849. ShowMenu(2);
  850. }
  851. else if (rc4.PtInRect(pt) && m_nMenuPos != 3)
  852. {
  853. ShowMenu(3);
  854. }
  855. }
  856. }
  857. //extern void LoadImageFromFile(Image **img, CString path);
  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. Gdiplus::Font *g_TimerFont;
  902. if (g_screenwid <= 1024)
  903. g_TimerFont = new Gdiplus::Font(L"黑体", 9);
  904. else
  905. g_TimerFont = new Gdiplus::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(IN BOOL bShow, IN BOOL bUpgrade)
  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 && bUpgrade)
  975. {
  976. m_bar.InitCtrl();
  977. m_bar.LinkClick("∧");
  978. }
  979. m_bar.ShowWindow(bShow);
  980. #endif
  981. }
  982. BOOL MainFrimDlg2::IsHasRightsHead(CString rights, CString name)
  983. {
  984. if (g_user.account == "admin")return 1;
  985. name = "*" + name + ";1;";
  986. int pos = rights.Find(name);
  987. if (pos == -1)return 0;
  988. return 1;
  989. }
  990. BOOL MainFrimDlg2::IsHasRightsItem(CString rights, CString head, CString name)
  991. {
  992. if (g_user.account == "admin")return 1;
  993. head = "*" + head + ";";
  994. int pos = rights.Find(head);
  995. if (pos == -1)return 0;
  996. rights = rights.Right(rights.GetLength() - pos - head.GetLength() - 2);
  997. pos = rights.Find("*");
  998. if (pos != -1)
  999. rights = rights.Left(pos);
  1000. if (name == "开单")
  1001. {
  1002. if (rights.Find("预约") != -1)return 1;
  1003. }
  1004. if (rights.Find(name) != -1)return 1;
  1005. return 0;
  1006. }
  1007. void MainFrimDlg2::EnableBtns(BOOL bEnable)
  1008. {
  1009. ((MyBmpButton2*)m_picarray.ElementAt(0))->EnableWindow(bEnable);
  1010. ((MyBmpButton2*)m_picarray.ElementAt(1))->EnableWindow(bEnable);
  1011. ((MyBmpButton2*)m_picarray.ElementAt(2))->EnableWindow(bEnable);
  1012. ((MyBmpButton2*)m_picarray.ElementAt(3))->EnableWindow(bEnable);
  1013. ((MyBmpButton2*)m_picarray.ElementAt(4))->EnableWindow(bEnable);
  1014. ((MyBmpButton2*)m_picarray.ElementAt(5))->EnableWindow(bEnable);
  1015. ((MyBmpButton2*)m_picarray.ElementAt(6))->EnableWindow(bEnable);
  1016. ((MyBmpButton2*)m_picarray.ElementAt(0))->ReDraw();
  1017. ((MyBmpButton2*)m_picarray.ElementAt(1))->ReDraw();
  1018. ((MyBmpButton2*)m_picarray.ElementAt(2))->ReDraw();
  1019. ((MyBmpButton2*)m_picarray.ElementAt(3))->ReDraw();
  1020. ((MyBmpButton2*)m_picarray.ElementAt(4))->ReDraw();
  1021. ((MyBmpButton2*)m_picarray.ElementAt(5))->ReDraw();
  1022. ((MyBmpButton2*)m_picarray.ElementAt(6))->ReDraw();
  1023. }
  1024. void MainFrimDlg2::RefreshOutlookBar2()
  1025. {
  1026. #ifdef BASIC_VERSION
  1027. return;
  1028. #endif
  1029. int count = m_wndOutlookBar.GetFolderCount();
  1030. while (count--)
  1031. m_wndOutlookBar.RemoveFolder(0);
  1032. int iFolder; // index of the added folder
  1033. int foldercount = 0;
  1034. CArray<CStringArray, CStringArray>List1array;
  1035. List1array.SetSize(15, 0);
  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(0).Add("员工资料");
  1043. List1array.ElementAt(1).Add("客服中心");
  1044. List1array.ElementAt(1).Add("摄控安排");
  1045. List1array.ElementAt(1).Add("选片预约");
  1046. List1array.ElementAt(1).Add("看样预约");
  1047. List1array.ElementAt(1).Add("取件预约");
  1048. #ifndef CHILD_VERSION
  1049. List1array.ElementAt (1).Add ("婚庆安排");
  1050. #endif
  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. List1array.ElementAt(2).Add("数码安排");
  1057. for (int i = 0; i < 15; i++)
  1058. {
  1059. while (List1array.ElementAt(i).GetSize() < 20)
  1060. List1array.ElementAt(i).Add("");
  1061. }
  1062. CString m_rights = g_user.rights2;
  1063. int nItem = 0;
  1064. CString str;
  1065. for (int a = 0; a < 3; a++)
  1066. {
  1067. for (int b = 0; b < 20; b++)
  1068. {
  1069. str = List1array.ElementAt(a).ElementAt(b);
  1070. if (str.IsEmpty())break;
  1071. if (b == 0)
  1072. {
  1073. if (1)//IsHasRightsHead(m_rights, str))
  1074. {
  1075. iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
  1076. }
  1077. else
  1078. break;
  1079. }
  1080. else
  1081. {
  1082. if (1)//IsHasRightsItem(m_rights, List1array.ElementAt (a).ElementAt (0), str))
  1083. {
  1084. m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
  1085. }
  1086. }
  1087. }
  1088. }
  1089. // We want to receive notification messages.
  1090. m_wndOutlookBar.SetOwner(this);
  1091. m_wndOutlookBar.SetSelFolder(0);
  1092. }
  1093. //提成比例
  1094. void MainFrimDlg2::RefreshOutlookBarLYFZ()
  1095. {
  1096. int count = m_wndOutlookBar.GetFolderCount();
  1097. while (count--)
  1098. m_wndOutlookBar.RemoveFolder(0);
  1099. int iFolder; // index of the added folder
  1100. int foldercount = 0;
  1101. g_OutlookBararray.RemoveAll();
  1102. g_OutlookBararray.SetSize(15, 0);
  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. g_OutlookBararray.ElementAt(foldercount).Add("客户来源");
  1114. foldercount++;
  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. g_OutlookBararray.ElementAt(foldercount).Add("数码安排");
  1126. foldercount++;
  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 ("员工工作");
  1134. g_OutlookBararray.ElementAt(foldercount).Add("计件提成"); // Jeff
  1135. g_OutlookBararray.ElementAt(foldercount).Add("工资管理");
  1136. g_OutlookBararray.ElementAt(foldercount).Add("员工奖罚");
  1137. foldercount++;
  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. g_OutlookBararray.ElementAt(foldercount).Add("客户区域");
  1150. foldercount++;
  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. g_OutlookBararray.ElementAt(foldercount).Add("短信设置");
  1159. foldercount++;
  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. g_OutlookBararray.ElementAt(foldercount).Add("积分短信");
  1165. foldercount++;
  1166. g_OutlookBararray.ElementAt(foldercount).Add("蓝钻会员");
  1167. g_OutlookBararray.ElementAt(foldercount).Add("转介绍返现");
  1168. g_OutlookBararray.ElementAt(foldercount).Add("转介绍图表");
  1169. g_OutlookBararray.ElementAt(foldercount).Add("积分设置");
  1170. foldercount++;
  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. g_OutlookBararray.ElementAt(foldercount).Add("固定资产管理");
  1177. foldercount++;
  1178. g_OutlookBararray.ElementAt(foldercount).Add("来电精灵");
  1179. g_OutlookBararray.ElementAt(foldercount).Add("客户来电");
  1180. g_OutlookBararray.ElementAt(foldercount).Add("拨出电话");
  1181. g_OutlookBararray.ElementAt(foldercount).Add("未接来电");
  1182. foldercount++;
  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. g_OutlookBararray.ElementAt(foldercount).Add("排班设置");
  1188. BOOL bHospital = 0;
  1189. if (g_cominfoarray.GetSize())
  1190. {
  1191. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
  1192. {
  1193. bHospital = 1;
  1194. }
  1195. }
  1196. if (bHospital)
  1197. {
  1198. foldercount++;
  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. g_OutlookBararray.ElementAt(foldercount).Add("资料设置");
  1205. }
  1206. for (int i = 0; i < 15; i++)
  1207. {
  1208. while (g_OutlookBararray.ElementAt(i).GetSize() < 20)
  1209. g_OutlookBararray.ElementAt(i).Add("");
  1210. }
  1211. CString m_rights = g_user.rights2;
  1212. int nItem = 0;
  1213. CString str;
  1214. int itemcount = 10;
  1215. if (bHospital)itemcount = 11;
  1216. for (int a = 0; a < itemcount; a++)
  1217. {
  1218. for (int b = 0; b < 20; b++)
  1219. {
  1220. str = g_OutlookBararray.ElementAt(a).ElementAt(b);
  1221. if (str.IsEmpty())break;
  1222. if (b == 0)
  1223. {
  1224. if (IsHasRightsHead(m_rights, str))
  1225. {
  1226. iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
  1227. }
  1228. else
  1229. break;
  1230. }
  1231. else
  1232. {
  1233. if (IsHasRightsItem(m_rights, g_OutlookBararray.ElementAt(a).ElementAt(0), str))
  1234. {
  1235. m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
  1236. }
  1237. }
  1238. }
  1239. }
  1240. // We want to receive notification messages.
  1241. m_wndOutlookBar.SetOwner(this);
  1242. m_wndOutlookBar.SetSelFolder(0);
  1243. }
  1244. void MainFrimDlg2::RefreshOutlookBar()//初始化侧边栏;
  1245. {
  1246. #ifdef BASIC_VERSION
  1247. return;
  1248. #endif
  1249. int count = m_wndOutlookBar.GetFolderCount();
  1250. while (count--)
  1251. m_wndOutlookBar.RemoveFolder(0);
  1252. int iFolder; // index of the added folder
  1253. int foldercount = 0;
  1254. g_OutlookBararray.RemoveAll();
  1255. g_OutlookBararray.SetSize(15, 0);
  1256. g_OutlookBararray.ElementAt(0).Add("门市流程");
  1257. g_OutlookBararray.ElementAt(0).Add("开单");
  1258. g_OutlookBararray.ElementAt(0).Add("拍照");
  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(1).Add("财务管理");
  1268. g_OutlookBararray.ElementAt(1).Add("订单收款");
  1269. g_OutlookBararray.ElementAt(1).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("计件提成"); // Jeff
  1275. g_OutlookBararray.ElementAt(1).Add("工资管理");
  1276. g_OutlookBararray.ElementAt(1).Add("员工奖罚");
  1277. g_OutlookBararray.ElementAt(2).Add("统计查询");
  1278. g_OutlookBararray.ElementAt(2).Add("日财务表");
  1279. g_OutlookBararray.ElementAt(2).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 (3).Add (" 短信群发 "); //// 2014.05.19 Jeff
  1290. g_OutlookBararray.ElementAt(3).Add(" 短信管理 "); //// 2014.05.19 Jeff
  1291. g_OutlookBararray.ElementAt(3).Add("短信群发");
  1292. g_OutlookBararray.ElementAt(3).Add("短信发送");
  1293. g_OutlookBararray.ElementAt(3).Add("流程短信");
  1294. g_OutlookBararray.ElementAt(3).Add("员工短信");
  1295. g_OutlookBararray.ElementAt(3).Add("发送记录");
  1296. g_OutlookBararray.ElementAt(3).Add("短信设置");
  1297. g_OutlookBararray.ElementAt(4).Add("会员管理");
  1298. g_OutlookBararray.ElementAt(4).Add("金卡会员");
  1299. g_OutlookBararray.ElementAt(4).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(5).Add("礼服管理");
  1307. g_OutlookBararray.ElementAt(5).Add("礼服录入");
  1308. g_OutlookBararray.ElementAt(5).Add("礼服查看");
  1309. g_OutlookBararray.ElementAt(5).Add("礼服出租");
  1310. g_OutlookBararray.ElementAt(5).Add("撞期预警");
  1311. g_OutlookBararray.ElementAt(5).Add("礼服图片");
  1312. g_OutlookBararray.ElementAt(6).Add("库存管理");
  1313. g_OutlookBararray.ElementAt(6).Add("入库单");
  1314. g_OutlookBararray.ElementAt(6).Add("出库单");
  1315. g_OutlookBararray.ElementAt(6).Add("库存查询");
  1316. g_OutlookBararray.ElementAt(6).Add("商品图表");
  1317. g_OutlookBararray.ElementAt(6).Add("固定资产管理");
  1318. g_OutlookBararray.ElementAt(7).Add("客户管理");
  1319. g_OutlookBararray.ElementAt(7).Add("订单客户");
  1320. g_OutlookBararray.ElementAt(7).Add("老客户");
  1321. g_OutlookBararray.ElementAt(7).Add("意向客户");
  1322. g_OutlookBararray.ElementAt(7).Add("客户流失");
  1323. g_OutlookBararray.ElementAt(7).Add("客户来源");
  1324. g_OutlookBararray.ElementAt(8).Add("来电精灵");
  1325. g_OutlookBararray.ElementAt(8).Add("客户来电");
  1326. g_OutlookBararray.ElementAt(8).Add("拨出电话");
  1327. g_OutlookBararray.ElementAt(8).Add("未接来电");
  1328. g_OutlookBararray.ElementAt(9).Add("员工考勤");
  1329. g_OutlookBararray.ElementAt(9).Add("考勤记录");
  1330. g_OutlookBararray.ElementAt(9).Add("月统计");
  1331. g_OutlookBararray.ElementAt(9).Add("时间设置");
  1332. g_OutlookBararray.ElementAt(9).Add("排班设置");
  1333. g_OutlookBararray.ElementAt(10).Add("客户服务");
  1334. g_OutlookBararray.ElementAt(10).Add("满意度");
  1335. g_OutlookBararray.ElementAt(10).Add("满意度汇总");
  1336. #if JEFF_DELETE_ON // 2014.11.14-PM 16:20
  1337. g_OutlookBararray.ElementAt(10).Add("回复统计");
  1338. #endif
  1339. BOOL bHospital = 0;
  1340. if (g_cominfoarray.GetSize())
  1341. {
  1342. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
  1343. {
  1344. bHospital = 1;
  1345. }
  1346. }
  1347. if (bHospital)
  1348. {
  1349. g_OutlookBararray.ElementAt(11).Add("医院跟踪系统");
  1350. g_OutlookBararray.ElementAt(11).Add("意向查询");
  1351. g_OutlookBararray.ElementAt(11).Add("意向单录入");
  1352. g_OutlookBararray.ElementAt(11).Add("今日提醒");
  1353. g_OutlookBararray.ElementAt(11).Add("跟踪短信");
  1354. g_OutlookBararray.ElementAt(11).Add("资料设置");
  1355. }
  1356. for (int i = 0; i < 15; i++)
  1357. {
  1358. while (g_OutlookBararray.ElementAt(i).GetSize() < 20)
  1359. g_OutlookBararray.ElementAt(i).Add("");
  1360. }
  1361. CString m_rights = g_user.rights2;
  1362. //printf("Jeff:用户权限=%s\n\n",m_rights);
  1363. int nItem = 0;
  1364. CString str;
  1365. int itemcount = 11;
  1366. if (bHospital)itemcount++;
  1367. for (int a = 0; a < itemcount; a++)
  1368. {
  1369. for (int b = 0; b < 20; b++)
  1370. {
  1371. str = g_OutlookBararray.ElementAt(a).ElementAt(b);
  1372. if (str.IsEmpty())break;
  1373. if (b == 0)
  1374. {
  1375. if (IsHasRightsHead(m_rights, str))
  1376. {
  1377. iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
  1378. }
  1379. else
  1380. break;
  1381. }
  1382. else
  1383. {
  1384. if (IsHasRightsItem(m_rights, g_OutlookBararray.ElementAt(a).ElementAt(0), str))
  1385. {
  1386. m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
  1387. }
  1388. }
  1389. }
  1390. }
  1391. // We want to receive notification messages.
  1392. m_wndOutlookBar.SetOwner(this);
  1393. m_wndOutlookBar.SetSelFolder(0);
  1394. }