MainFrimDlg2.cpp 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275
  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. void MainFrimDlg2::Init2()
  283. {
  284. CRect rc = m_rcarray.ElementAt(15);
  285. // rc.top-=5;
  286. // rc.bottom-=7;
  287. if (!m_wndOutlookBar.Create(WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, rc, this, 0, OBS_XT_DEFAULT))
  288. {
  289. TRACE0("Failed to create outlook bar.");
  290. return;
  291. }
  292. // Set the background and text color of the outlook bar.
  293. if (g_bRedSkin)
  294. m_wndOutlookBar.SetBackColor(RGB(112, 29, 55));
  295. else
  296. m_wndOutlookBar.SetBackColor(RGB(70, 70, 70));
  297. m_wndOutlookBar.SetTextColor(RGB(0xff, 0xff, 0xff));
  298. // Add items to the outlook bar.
  299. InitializeOutlookBar();
  300. // CDC* pdc = GetDC();
  301. // m_gifDC = new CDC;
  302. // m_gifDC->Attach(pdc->GetSafeHdc());
  303. // AfxBeginThread(GifThread,(LPVOID)m_gifDC);
  304. }
  305. static UINT nIcons[] =
  306. {
  307. IDI_ICON1, IDI_ICON3, IDI_ICON4, IDI_ICON7,
  308. IDI_ICON8, IDI_ICON2, IDI_ICON11, IDI_ICON6,
  309. IDI_ICON9, IDI_ICON10, IDI_ICON5
  310. };
  311. // 初始化侧边栏;
  312. void MainFrimDlg2::InitializeOutlookBar()
  313. {
  314. // Create the image lists used by the outlook bar.
  315. m_ImageSmall.Create(16, 16, ILC_COLOR16 | ILC_MASK, 2, 1);
  316. m_ImageLarge.Create(32, 32, ILC_COLOR16 | ILC_MASK, 2, 1);
  317. // initiailize the image lists.
  318. for (int i = 0; i < 11; ++i)
  319. {
  320. HICON hIcon = AfxGetApp()->LoadIcon(nIcons[i]);
  321. ASSERT(hIcon);
  322. m_ImageSmall.Add(hIcon);
  323. m_ImageLarge.Add(hIcon);
  324. }
  325. int iFolder; // index of the added folder
  326. /* CString rights=AfxGetApp()->GetProfileString (LYFZVERSION, "hidewindow", "");
  327. if(rights.IsEmpty ())rights="111111111111111";
  328. BOOL bHide=AfxGetApp()->GetProfileInt (LYFZVERSION, "hidewindow2", 0);
  329. */
  330. CString rights;
  331. int foldercount = 0;
  332. // set the image lists for the outlook bar.
  333. m_wndOutlookBar.SetImageList(&m_ImageLarge, OBS_XT_LARGEICON);
  334. m_wndOutlookBar.SetImageList(&m_ImageSmall, OBS_XT_SMALLICON);
  335. #ifdef BASIC_VERSION
  336. if(IsHasRight(rights,"门市流程"))
  337. {
  338. // Add the first folder to the outlook bar.
  339. iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), foldercount);foldercount++;
  340. // Add items to the folder, syntax is folder, index, text, image, and item data.
  341. m_wndOutlookBar.InsertItem(iFolder, 1, _T("开单"), 0, NULL);
  342. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拍照"), 1, NULL);
  343. m_wndOutlookBar.InsertItem(iFolder, 3, _T("修片"), 2, NULL);
  344. m_wndOutlookBar.InsertItem(iFolder, 4, _T("选片"), 3, NULL);
  345. m_wndOutlookBar.InsertItem(iFolder, 5, _T("精修"), 4, NULL);
  346. m_wndOutlookBar.InsertItem(iFolder, 6, _T("设计"), 5, NULL);
  347. m_wndOutlookBar.InsertItem(iFolder, 7, _T("刻盘"), 6, NULL);
  348. m_wndOutlookBar.InsertItem(iFolder, 8, _T("发片/取件"), 7, NULL);
  349. m_wndOutlookBar.InsertItem(iFolder, 9, _T("数码安排"), 8, NULL);
  350. }
  351. if(IsHasRight(rights,"财务管理"))
  352. {
  353. // Add the second folder to the outlook bar.
  354. iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), foldercount);foldercount++;
  355. // Add items to the folder, syntax is folder, index, text, image, and item data.
  356. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单收款"), 0, NULL);
  357. m_wndOutlookBar.InsertItem(iFolder, 2, _T("现金支出"), 1, NULL);
  358. m_wndOutlookBar.InsertItem(iFolder, 3, _T("其它收入"), 2, NULL);
  359. m_wndOutlookBar.InsertItem(iFolder, 4, _T("其它二销"), 3, NULL);
  360. // m_wndOutlookBar.InsertItem(iFolder, 5, _T("员工奖罚"), 4, NULL);
  361. // m_wndOutlookBar.InsertItem(iFolder, 6, _T("日财务表"), 5, NULL);
  362. // m_wndOutlookBar.InsertItem(iFolder, 7, _T("工资管理"), 6, NULL);
  363. m_wndOutlookBar.InsertItem(iFolder, 5, _T("客人付款"), 6, NULL);
  364. }
  365. //if(IsHasRight(rights,"短信群发"))
  366. if(IsHasRight(rights,"短信管理"))
  367. {
  368. //iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), foldercount);foldercount++;
  369. iFolder = m_wndOutlookBar.AddFolder(_T("短信管理"), foldercount);foldercount++;
  370. // Add items to the folder, syntax is folder, index, text, image, and item data.
  371. m_wndOutlookBar.InsertItem(iFolder, 1, _T("短信群发"), 0, NULL);
  372. m_wndOutlookBar.InsertItem(iFolder, 2, _T("短信发送"), 1, NULL);
  373. m_wndOutlookBar.InsertItem(iFolder, 3, _T("流程短信"), 2, NULL);
  374. m_wndOutlookBar.InsertItem(iFolder, 4, _T("员工短信"), 3, NULL);
  375. m_wndOutlookBar.InsertItem(iFolder, 5, _T("发送记录"), 4, NULL);
  376. m_wndOutlookBar.InsertItem(iFolder, 6, _T("短信设置"), 5, NULL);
  377. }
  378. #ifdef BASIC_ADDPHONE
  379. if(IsHasRight(rights,"客户管理"))
  380. {
  381. iFolder = m_wndOutlookBar.AddFolder(_T("客户管理"), foldercount);foldercount++;
  382. // Add items to the folder, syntax is folder, index, text, image, and item data.
  383. m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单客户"), 0, NULL);
  384. m_wndOutlookBar.InsertItem(iFolder, 2, _T("老客户"), 1, NULL);
  385. m_wndOutlookBar.InsertItem(iFolder, 3, _T("意向客户"), 2, NULL);
  386. m_wndOutlookBar.InsertItem(iFolder, 4, _T("客户流失"), 3, NULL);
  387. m_wndOutlookBar.InsertItem(iFolder, 5, _T("客户来源"), 4, NULL);
  388. }
  389. #endif
  390. #ifdef BASIC_ADDDRESS
  391. if(IsHasRight(rights,"礼服管理"))
  392. {
  393. iFolder = m_wndOutlookBar.AddFolder(_T("礼服管理"), foldercount);foldercount++;
  394. // Add items to the folder, syntax is folder, index, text, image, and item data.
  395. m_wndOutlookBar.InsertItem(iFolder, 1, _T("礼服录入"), 0, NULL);
  396. m_wndOutlookBar.InsertItem(iFolder, 2, _T("礼服查看"), 1, NULL);
  397. m_wndOutlookBar.InsertItem(iFolder, 3, _T("撞期预警"), 2, NULL);
  398. m_wndOutlookBar.InsertItem(iFolder, 4, _T("图片欣赏"), 3, NULL);
  399. m_wndOutlookBar.InsertItem(iFolder, 5, _T("礼服出租"), 4, NULL);
  400. }
  401. #endif
  402. if(IsHasRight(rights,"来电精灵"))
  403. {
  404. iFolder = m_wndOutlookBar.AddFolder(_T("来电精灵"), foldercount);foldercount++;
  405. // Add items to the folder, syntax is folder, index, text, image, and item data.
  406. m_wndOutlookBar.InsertItem(iFolder, 1, _T("客户来电"), 0, NULL);
  407. m_wndOutlookBar.InsertItem(iFolder, 2, _T("拨出电话"), 1, NULL);
  408. m_wndOutlookBar.InsertItem(iFolder, 3, _T("未接来电"), 2, NULL);
  409. }
  410. #ifdef BASIC_ADDMEMBER
  411. if(IsHasRight(rights,"会员管理"))
  412. {
  413. iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), foldercount);foldercount++;
  414. // Add items to the folder, syntax is folder, index, text, image, and item data.
  415. m_wndOutlookBar.InsertItem(iFolder, 1, _T("金卡会员"), 0, NULL);
  416. m_wndOutlookBar.InsertItem(iFolder, 2, _T("转介绍积分"), 1, NULL);
  417. m_wndOutlookBar.InsertItem(iFolder, 3, _T("转介绍图表"), 2, NULL);
  418. m_wndOutlookBar.InsertItem(iFolder, 4, _T("蓝钻会员"), 3, NULL);
  419. m_wndOutlookBar.InsertItem(iFolder, 4, _T("转介绍返现"), 4, NULL);
  420. m_wndOutlookBar.InsertItem(iFolder, 5, _T("转介绍图表2"), 5, NULL);
  421. m_wndOutlookBar.InsertItem(iFolder, 6, _T("积分设置"),6, NULL);
  422. }
  423. #endif
  424. #else
  425. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  426. RefreshOutlookBar();
  427. #endif
  428. }
  429. LRESULT MainFrimDlg2::OnOutbarNotify(WPARAM wParam, LPARAM lParam)
  430. {
  431. int nBarAction = (int)wParam;
  432. // Cast the lParam to a XT_OUTBAR_INFO* struct pointer.
  433. XT_OUTBAR_INFO* pOBInfo = (XT_OUTBAR_INFO*)lParam;
  434. ASSERT(pOBInfo);
  435. switch (nBarAction)
  436. {
  437. case OBN_XT_ITEMCLICK:
  438. {
  439. CString strMsg = pOBInfo->lpszText;
  440. g_pMainWnd->OnOutbarNotify(strMsg);
  441. // AfxMessageBox(strMsg);
  442. // TRACE2( "Item selected: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  443. }
  444. break;
  445. /* case OBN_XT_FOLDERCHANGE:
  446. TRACE2( "Folder selected: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  447. break;
  448. case OBN_XT_ONLABELENDEDIT:
  449. TRACE2( "Item edited: %d, New name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  450. break;
  451. case OBN_XT_ONGROUPENDEDIT:
  452. TRACE2( "Folder edited: %d, New name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  453. break;
  454. case OBN_XT_DRAGITEM:
  455. TRACE3( "Dragging From: %d, To: %d, Name: %s.\n", pOBInfo->nDragFrom, pOBInfo->nDragTo, pOBInfo->lpszText);
  456. break;
  457. case OBN_XT_ITEMHOVER:
  458. TRACE2( "Hovering Item: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  459. break;
  460. case OBN_XT_DELETEITEM:
  461. if (!m_bDestroy && AfxMessageBox(_T("Are you sure you want to remove this folder shortcut?"),
  462. MB_ICONWARNING|MB_YESNO) == IDNO)
  463. {
  464. // The user selected No, return FALSE to abort the action.
  465. return FALSE;
  466. }
  467. TRACE2( "Item deleted: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  468. break;
  469. case OBN_XT_DELETEFOLDER:
  470. if (!m_bDestroy && AfxMessageBox(_T("Are you sure you want to remove the specified folder?"),
  471. MB_ICONWARNING|MB_YESNO) == IDNO)
  472. {
  473. // The user selected No, return FALSE to abort the action.
  474. return FALSE;
  475. }
  476. TRACE2( "Folder deleted: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
  477. break;*/
  478. }
  479. return TRUE;
  480. }
  481. void MainFrimDlg2::SetSelFolder(int pos)
  482. {
  483. m_wndOutlookBar.SetSelFolder(pos);
  484. }
  485. void MainFrimDlg2::ShowMenu(int pos)
  486. {
  487. printf("\t\t显示菜单,第[%d]个菜单\n", pos + 1);
  488. m_bLoadMenu = 1;
  489. m_nMenuPos = pos;
  490. CRect rc = m_rcarray.ElementAt(7 + pos);
  491. 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());
  492. CMenuXP *pPopup;
  493. pPopup = new CMenuXP;
  494. pPopup->CYBUTTONMARGIN = 3;
  495. pPopup->CreatePopupMenu();
  496. pPopup->SetMenuStyle(CMenuXP::STYLE_XP);
  497. CString text;
  498. {
  499. CMenu *pMenu = g_pMainWnd->GetMenu();
  500. CMenu* submenu = pMenu->GetSubMenu(pos);
  501. BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status", 0);
  502. CArray<DWORD, DWORD>delidarray;
  503. int count = g_pMainWnd->m_Mdi.GetCount(); if (count == -1)count = 0;
  504. if (pos == 2)//&& count)
  505. {
  506. // submenu->DeleteMenu (65280, MF_BYCOMMAND);
  507. // count=submenu->GetMenuItemCount ()-2;
  508. count = submenu->GetMenuItemCount();
  509. // submenu->DeleteMenu (count-1, MF_BYPOSITION);count--;
  510. }
  511. else
  512. count = submenu->GetMenuItemCount();
  513. int i = 0;
  514. for (i = 0; i < count; i++)
  515. {
  516. // submenu->GetMenuString(submenu->GetMenuItemID(i), text, MF_BYCOMMAND);
  517. submenu->GetMenuString(i, text, MF_BYPOSITION);
  518. if (text.IsEmpty())
  519. {
  520. if (!(pos == 2 && i > 11))
  521. pPopup->AppendSeparator();
  522. }
  523. else
  524. {
  525. if (pos == 2 && i > 10)
  526. {
  527. DWORD id = submenu->GetMenuItemID(i);
  528. if (id > 1010)
  529. {
  530. delidarray.Add(id); continue;
  531. }
  532. // if(text.Find("查看历史数据")==-1)
  533. // {
  534. // submenu->DeleteMenu (i, MF_BYPOSITION);
  535. // MessageBox(str);
  536. // continue;
  537. // }
  538. } // CString str;
  539. // str.Format(":%d", submenu->GetMenuItemID(i));
  540. pPopup->AppendODMenu2(0, new CMenuXPText(submenu->GetMenuItemID(i), text, NULL));
  541. if (pos == 1 && i == 12 && checked)
  542. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  543. else if (pos == 1 && i == 13 && g_bStaffAchievementShow)
  544. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  545. else if (pos == 2 && i == 10 && g_bShowOK == 0)
  546. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  547. else if (pos == 2 && i > 10)
  548. {
  549. UINT status = submenu->GetMenuState(submenu->GetMenuItemID(i), MF_BYCOMMAND);
  550. if (status&MF_CHECKED)
  551. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  552. }
  553. else if (pos == 0 && i > 5)
  554. {
  555. UINT status = submenu->GetMenuState(submenu->GetMenuItemID(i), MF_BYCOMMAND);
  556. if (status&MF_CHECKED)
  557. pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
  558. }
  559. }
  560. }
  561. for (i = delidarray.GetSize() - 1; i >= 0; i--)
  562. submenu->DeleteMenu(delidarray.ElementAt(i), MF_BYCOMMAND);
  563. }
  564. rc.left += 5;
  565. pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, rc.left, rc.bottom, g_pMainWnd, 0);
  566. delete pPopup;
  567. }
  568. void MainFrimDlg2::MouseMove()
  569. {
  570. if (m_bLoadMenu)
  571. {
  572. CPoint pt;
  573. ::GetCursorPos(&pt);
  574. ScreenToClient(&pt);
  575. CRect rc = m_rcarray.ElementAt(7);
  576. CRect rc2 = m_rcarray.ElementAt(8);
  577. CRect rc3 = m_rcarray.ElementAt(9);
  578. CRect rc4 = m_rcarray.ElementAt(10);
  579. if (rc.PtInRect(pt) && m_nMenuPos != 0)
  580. {
  581. ShowMenu(0);
  582. }
  583. else if (rc2.PtInRect(pt) && m_nMenuPos != 1)
  584. {
  585. ShowMenu(1);
  586. }
  587. else if (rc3.PtInRect(pt) && m_nMenuPos != 2)
  588. {
  589. ShowMenu(2);
  590. }
  591. else if (rc4.PtInRect(pt) && m_nMenuPos != 3)
  592. {
  593. ShowMenu(3);
  594. }
  595. }
  596. }
  597. //extern void LoadImageFromFile(Image **img, CString path);
  598. extern BOOL g_bDrawLogin;
  599. void MainFrimDlg2::DrawLogin()
  600. {
  601. if (!g_bDrawLogin)
  602. return;
  603. CDC *pDC = GetDC();
  604. Graphics graph(pDC->GetSafeHdc());
  605. CRect rc = m_rcarray.ElementAt(14); rc.right += 60;
  606. RectF layoutRect(rc.left, rc.top, rc.Width(), rc.Height());
  607. Rect destinationRect(rc.left, rc.top, rc.Width(), rc.Height());
  608. if (1)
  609. {
  610. CRect rc;
  611. HWND wnd = ::FindWindow("Shell_TrayWnd", 0);
  612. ::GetWindowRect(wnd, &rc);
  613. int hei = rc.Height();
  614. rc = CRect(0, 0, g_screenwid, g_screenhei - hei);
  615. g_fscalex = (float)g_screenwid / 2000.0;
  616. g_fscaley = (float)(g_screenhei - hei) / 1400.0;
  617. }
  618. rc.left /= g_fscalex;
  619. rc.right /= g_fscalex;
  620. rc.top /= g_fscaley;
  621. rc.bottom /= g_fscaley;
  622. graph.SetSmoothingMode(SmoothingModeHighQuality);
  623. graph.DrawImage(m_pBk, destinationRect, rc.left, rc.top, rc.Width(), rc.Height(), UnitPixel);
  624. StringFormat format;
  625. format.SetAlignment(StringAlignmentNear);
  626. SolidBrush *Brush = new SolidBrush(Color(255, 255, 255, 255));
  627. CString str;
  628. if (g_user.bLongin)
  629. str = g_user.name + " (联机) " + g_branchname;
  630. else
  631. str = "未登录 " + g_branchname;
  632. if (g_bAllBranch)
  633. {
  634. if (g_user.bLongin)
  635. str = g_user.name + " (联机) 多店汇总";
  636. else
  637. str = "未登录 多店汇总";
  638. }
  639. int leng = GetLengthEx(str);
  640. BSTR bstr = str.AllocSysString();
  641. Gdiplus::Font *g_TimerFont;
  642. if (g_screenwid <= 1024)
  643. g_TimerFont = new Gdiplus::Font(L"黑体", 9);
  644. else
  645. g_TimerFont = new Gdiplus::Font(L"黑体", 10);
  646. graph.SetTextRenderingHint(TextRenderingHintAntiAlias);
  647. graph.DrawString(
  648. bstr,
  649. leng,
  650. g_TimerFont,
  651. layoutRect,
  652. &format,
  653. Brush);
  654. delete Brush;
  655. delete g_TimerFont;
  656. SysFreeString(bstr);
  657. ReleaseDC(pDC);
  658. }
  659. void MainFrimDlg2::UseRgn(BOOL bUse)
  660. {
  661. if (bUse == 0)
  662. {
  663. CRect rc; GetClientRect(rc);
  664. CRgn rgn1, rgn2, rgn3;
  665. rgn1.CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
  666. rc = m_rcarray.ElementAt(16);
  667. rgn2.CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
  668. rgn1.CombineRgn(&rgn1, &rgn2, RGN_DIFF);
  669. ::SetWindowRgn(m_hWnd, rgn1, 1);
  670. }
  671. else
  672. {
  673. CRect rc;
  674. GetClientRect(rc);
  675. CRgn rgn2;
  676. rgn2.CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
  677. ::SetWindowRgn(m_hWnd, rgn2, 1);
  678. }
  679. // ShowBar(bUse);
  680. }
  681. BOOL MainFrimDlg2::IsHasRight(CString rights, CString name)
  682. {
  683. return 1;
  684. CStringArray array;
  685. array.Add(_T("门市流程"));
  686. array.Add(_T("财务管理"));
  687. array.Add(_T("统计查询"));
  688. //array.Add(_T("短信群发"));//Jeff
  689. array.Add(_T("短信管理"));//Jeff
  690. array.Add(_T("会员管理"));
  691. array.Add(_T("礼服管理"));
  692. array.Add(_T("库存管理"));
  693. array.Add(_T("客户管理"));
  694. array.Add(_T("来电精灵"));
  695. array.Add(_T("员工考勤"));
  696. for (int i = 0; i < array.GetSize(); i++)
  697. {
  698. if (name == array.ElementAt(i))
  699. {
  700. return atoi(rights.Mid(i, 1));
  701. }
  702. }
  703. return 0;
  704. }
  705. void MainFrimDlg2::ShowBar(IN BOOL bShow, IN BOOL bUpgrade)
  706. {
  707. #ifndef BASIC_VERSION
  708. if (g_bShowBar == 0 && bShow)return;
  709. if (g_bAllBranch)
  710. {
  711. m_bar.ShowWindow(0);
  712. return;
  713. }
  714. if (bShow && bUpgrade)
  715. {
  716. m_bar.InitCtrl();
  717. m_bar.LinkClick("∧");
  718. }
  719. m_bar.ShowWindow(bShow);
  720. #endif
  721. }
  722. BOOL MainFrimDlg2::IsHasRightsHead(CString rights, CString name)
  723. {
  724. if (g_user.account == "admin")return 1;
  725. name = "*" + name + ";1;";
  726. int pos = rights.Find(name);
  727. if (pos == -1)return 0;
  728. return 1;
  729. }
  730. BOOL MainFrimDlg2::IsHasRightsItem(CString rights, CString head, CString name)
  731. {
  732. if (g_user.account == "admin")return 1;
  733. head = "*" + head + ";";
  734. int pos = rights.Find(head);
  735. if (pos == -1)return 0;
  736. rights = rights.Right(rights.GetLength() - pos - head.GetLength() - 2);
  737. pos = rights.Find("*");
  738. if (pos != -1)
  739. rights = rights.Left(pos);
  740. if (name == "开单")
  741. {
  742. if (rights.Find("预约") != -1)return 1;
  743. }
  744. if (rights.Find(name) != -1)return 1;
  745. return 0;
  746. }
  747. void MainFrimDlg2::EnableBtns(BOOL bEnable)
  748. {
  749. ((MyBmpButton2*)m_picarray.ElementAt(0))->EnableWindow(bEnable);
  750. ((MyBmpButton2*)m_picarray.ElementAt(1))->EnableWindow(bEnable);
  751. ((MyBmpButton2*)m_picarray.ElementAt(2))->EnableWindow(bEnable);
  752. ((MyBmpButton2*)m_picarray.ElementAt(3))->EnableWindow(bEnable);
  753. ((MyBmpButton2*)m_picarray.ElementAt(4))->EnableWindow(bEnable);
  754. ((MyBmpButton2*)m_picarray.ElementAt(5))->EnableWindow(bEnable);
  755. ((MyBmpButton2*)m_picarray.ElementAt(6))->EnableWindow(bEnable);
  756. ((MyBmpButton2*)m_picarray.ElementAt(0))->ReDraw();
  757. ((MyBmpButton2*)m_picarray.ElementAt(1))->ReDraw();
  758. ((MyBmpButton2*)m_picarray.ElementAt(2))->ReDraw();
  759. ((MyBmpButton2*)m_picarray.ElementAt(3))->ReDraw();
  760. ((MyBmpButton2*)m_picarray.ElementAt(4))->ReDraw();
  761. ((MyBmpButton2*)m_picarray.ElementAt(5))->ReDraw();
  762. ((MyBmpButton2*)m_picarray.ElementAt(6))->ReDraw();
  763. }
  764. void MainFrimDlg2::RefreshOutlookBar2()
  765. {
  766. #ifdef BASIC_VERSION
  767. return;
  768. #endif
  769. int count = m_wndOutlookBar.GetFolderCount();
  770. while (count--)
  771. m_wndOutlookBar.RemoveFolder(0);
  772. int iFolder; // index of the added folder
  773. int foldercount = 0;
  774. CArray<CStringArray, CStringArray>List1array;
  775. List1array.SetSize(15, 0);
  776. List1array.ElementAt(0).Add("分店汇总");
  777. List1array.ElementAt(0).Add("订单报表");
  778. List1array.ElementAt(0).Add("发片/取件");
  779. List1array.ElementAt(0).Add("相片冲印");
  780. List1array.ElementAt(0).Add("金卡会员");
  781. List1array.ElementAt(0).Add("现金子卡");
  782. List1array.ElementAt(0).Add("员工资料");
  783. List1array.ElementAt(1).Add("客服中心");
  784. List1array.ElementAt(1).Add("摄控安排");
  785. List1array.ElementAt(1).Add("选片预约");
  786. List1array.ElementAt(1).Add("看样预约");
  787. List1array.ElementAt(1).Add("取件预约");
  788. #ifndef CHILD_VERSION
  789. List1array.ElementAt (1).Add ("婚庆安排");
  790. #endif
  791. List1array.ElementAt(2).Add("数码中心");
  792. List1array.ElementAt(2).Add("拍照");
  793. List1array.ElementAt(2).Add("修片");
  794. List1array.ElementAt(2).Add("精修");
  795. List1array.ElementAt(2).Add("设计");
  796. List1array.ElementAt(2).Add("数码安排");
  797. for (int i = 0; i < 15; i++)
  798. {
  799. while (List1array.ElementAt(i).GetSize() < 20)
  800. List1array.ElementAt(i).Add("");
  801. }
  802. CString m_rights = g_user.rights2;
  803. int nItem = 0;
  804. CString str;
  805. for (int a = 0; a < 3; a++)
  806. {
  807. for (int b = 0; b < 20; b++)
  808. {
  809. str = List1array.ElementAt(a).ElementAt(b);
  810. if (str.IsEmpty())break;
  811. if (b == 0)
  812. {
  813. if (1)//IsHasRightsHead(m_rights, str))
  814. {
  815. iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
  816. }
  817. else
  818. break;
  819. }
  820. else
  821. {
  822. if (1)//IsHasRightsItem(m_rights, List1array.ElementAt (a).ElementAt (0), str))
  823. {
  824. m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
  825. }
  826. }
  827. }
  828. }
  829. // We want to receive notification messages.
  830. m_wndOutlookBar.SetOwner(this);
  831. m_wndOutlookBar.SetSelFolder(0);
  832. }
  833. //提成比例
  834. #if 0
  835. void MainFrimDlg2::RefreshOutlookBarLYFZ()
  836. {
  837. int count = m_wndOutlookBar.GetFolderCount();
  838. while (count--)
  839. m_wndOutlookBar.RemoveFolder(0);
  840. int iFolder; // index of the added folder
  841. int foldercount = 0;
  842. g_OutlookBararray.RemoveAll();
  843. g_OutlookBararray.SetSize(15, 0);
  844. g_OutlookBararray.ElementAt(foldercount).Add("客户管理");
  845. g_OutlookBararray.ElementAt(foldercount).Add("意向客户");
  846. g_OutlookBararray.ElementAt(foldercount).Add("服务记录");
  847. g_OutlookBararray.ElementAt(foldercount).Add("服务统计");
  848. g_OutlookBararray.ElementAt(foldercount).Add("每日签到");
  849. g_OutlookBararray.ElementAt(foldercount).Add("服务费");
  850. g_OutlookBararray.ElementAt(foldercount).Add("客户短信");
  851. g_OutlookBararray.ElementAt(foldercount).Add("满意度");
  852. g_OutlookBararray.ElementAt(foldercount).Add("满意度汇总");
  853. g_OutlookBararray.ElementAt(foldercount).Add("客户流失");
  854. g_OutlookBararray.ElementAt(foldercount).Add("客户来源");
  855. foldercount++;
  856. g_OutlookBararray.ElementAt(foldercount).Add("门市流程");
  857. g_OutlookBararray.ElementAt(foldercount).Add("开单");
  858. g_OutlookBararray.ElementAt(foldercount).Add("拍照");
  859. g_OutlookBararray.ElementAt(foldercount).Add("修片");
  860. g_OutlookBararray.ElementAt(foldercount).Add("选片");
  861. g_OutlookBararray.ElementAt(foldercount).Add("精修");
  862. g_OutlookBararray.ElementAt(foldercount).Add("设计");
  863. g_OutlookBararray.ElementAt(foldercount).Add("刻盘");
  864. g_OutlookBararray.ElementAt(foldercount).Add("相片冲印");
  865. g_OutlookBararray.ElementAt(foldercount).Add("发片/取件");
  866. g_OutlookBararray.ElementAt(foldercount).Add("数码安排");
  867. foldercount++;
  868. g_OutlookBararray.ElementAt(foldercount).Add("财务管理");
  869. g_OutlookBararray.ElementAt(foldercount).Add("订单收款");
  870. g_OutlookBararray.ElementAt(foldercount).Add("其它二销");
  871. g_OutlookBararray.ElementAt(foldercount).Add("现金支出");
  872. g_OutlookBararray.ElementAt(foldercount).Add("其它收入");
  873. g_OutlookBararray.ElementAt(foldercount).Add("提成比例");
  874. //g_OutlookBararray.ElementAt (foldercount).Add ("员工工作");
  875. g_OutlookBararray.ElementAt(foldercount).Add("计件提成"); // Jeff
  876. g_OutlookBararray.ElementAt(foldercount).Add("工资管理");
  877. g_OutlookBararray.ElementAt(foldercount).Add("员工奖罚");
  878. foldercount++;
  879. g_OutlookBararray.ElementAt(foldercount).Add("统计查询");
  880. g_OutlookBararray.ElementAt(foldercount).Add("日财务表");
  881. g_OutlookBararray.ElementAt(foldercount).Add("月财务表");
  882. g_OutlookBararray.ElementAt(foldercount).Add("年财务表");
  883. g_OutlookBararray.ElementAt(foldercount).Add("年财务图表");
  884. g_OutlookBararray.ElementAt(foldercount).Add("订单图表");
  885. g_OutlookBararray.ElementAt(foldercount).Add("成本核算");
  886. g_OutlookBararray.ElementAt(foldercount).Add("工资报表");
  887. g_OutlookBararray.ElementAt(foldercount).Add("员工业绩");
  888. g_OutlookBararray.ElementAt(foldercount).Add("员工资料");
  889. g_OutlookBararray.ElementAt(foldercount).Add("员工奖惩");
  890. g_OutlookBararray.ElementAt(foldercount).Add("客户区域");
  891. foldercount++;
  892. // g_OutlookBararray.ElementAt (foldercount).Add (" 短信群发 ");
  893. g_OutlookBararray.ElementAt(foldercount).Add(" 短信管理 ");
  894. g_OutlookBararray.ElementAt(foldercount).Add("短信群发");
  895. g_OutlookBararray.ElementAt(foldercount).Add("短信发送");
  896. g_OutlookBararray.ElementAt(foldercount).Add("流程短信");
  897. g_OutlookBararray.ElementAt(foldercount).Add("员工短信");
  898. g_OutlookBararray.ElementAt(foldercount).Add("发送记录");
  899. g_OutlookBararray.ElementAt(foldercount).Add("短信设置");
  900. foldercount++;
  901. g_OutlookBararray.ElementAt(foldercount).Add("会员管理");
  902. g_OutlookBararray.ElementAt(foldercount).Add("金卡会员");
  903. g_OutlookBararray.ElementAt(foldercount).Add("现金子卡");
  904. g_OutlookBararray.ElementAt(foldercount).Add("金卡图表");
  905. g_OutlookBararray.ElementAt(foldercount).Add("积分短信");
  906. foldercount++;
  907. g_OutlookBararray.ElementAt(foldercount).Add("蓝钻会员");
  908. g_OutlookBararray.ElementAt(foldercount).Add("转介绍返现");
  909. g_OutlookBararray.ElementAt(foldercount).Add("转介绍图表");
  910. g_OutlookBararray.ElementAt(foldercount).Add("积分设置");
  911. foldercount++;
  912. g_OutlookBararray.ElementAt(foldercount).Add("库存管理");
  913. g_OutlookBararray.ElementAt(foldercount).Add("入库单");
  914. g_OutlookBararray.ElementAt(foldercount).Add("出库单");
  915. g_OutlookBararray.ElementAt(foldercount).Add("库存查询");
  916. g_OutlookBararray.ElementAt(foldercount).Add("商品图表");
  917. g_OutlookBararray.ElementAt(foldercount).Add("固定资产管理");
  918. foldercount++;
  919. g_OutlookBararray.ElementAt(foldercount).Add("来电精灵");
  920. g_OutlookBararray.ElementAt(foldercount).Add("客户来电");
  921. g_OutlookBararray.ElementAt(foldercount).Add("拨出电话");
  922. g_OutlookBararray.ElementAt(foldercount).Add("未接来电");
  923. foldercount++;
  924. g_OutlookBararray.ElementAt(foldercount).Add("员工考勤");
  925. g_OutlookBararray.ElementAt(foldercount).Add("考勤记录");
  926. g_OutlookBararray.ElementAt(foldercount).Add("月统计");
  927. g_OutlookBararray.ElementAt(foldercount).Add("时间设置");
  928. g_OutlookBararray.ElementAt(foldercount).Add("排班设置");
  929. BOOL bHospital = 0;
  930. if (g_cominfoarray.GetSize())
  931. {
  932. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
  933. {
  934. bHospital = 1;
  935. }
  936. }
  937. if (bHospital)
  938. {
  939. foldercount++;
  940. g_OutlookBararray.ElementAt(foldercount).Add("医院跟踪系统");
  941. g_OutlookBararray.ElementAt(foldercount).Add("意向查询");
  942. g_OutlookBararray.ElementAt(foldercount).Add("意向单录入");
  943. g_OutlookBararray.ElementAt(foldercount).Add("今日提醒");
  944. g_OutlookBararray.ElementAt(foldercount).Add("跟踪短信");
  945. g_OutlookBararray.ElementAt(foldercount).Add("资料设置");
  946. }
  947. for (int i = 0; i < 15; i++)
  948. {
  949. while (g_OutlookBararray.ElementAt(i).GetSize() < 20)
  950. g_OutlookBararray.ElementAt(i).Add("");
  951. }
  952. CString m_rights = g_user.rights2;
  953. int nItem = 0;
  954. CString str;
  955. int itemcount = 10;
  956. if (bHospital)itemcount = 11;
  957. for (int a = 0; a < itemcount; a++)
  958. {
  959. for (int b = 0; b < 20; b++)
  960. {
  961. str = g_OutlookBararray.ElementAt(a).ElementAt(b);
  962. if (str.IsEmpty())break;
  963. if (b == 0)
  964. {
  965. if (IsHasRightsHead(m_rights, str))
  966. {
  967. iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
  968. }
  969. else
  970. break;
  971. }
  972. else
  973. {
  974. if (IsHasRightsItem(m_rights, g_OutlookBararray.ElementAt(a).ElementAt(0), str))
  975. {
  976. m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
  977. }
  978. }
  979. }
  980. }
  981. // We want to receive notification messages.
  982. m_wndOutlookBar.SetOwner(this);
  983. m_wndOutlookBar.SetSelFolder(0);
  984. }
  985. #endif
  986. void MainFrimDlg2::RefreshOutlookBar()//初始化侧边栏;
  987. {
  988. #ifdef BASIC_VERSION
  989. return;
  990. #endif
  991. int count = m_wndOutlookBar.GetFolderCount();
  992. while (count--)
  993. m_wndOutlookBar.RemoveFolder(0);
  994. int iFolder; // index of the added folder
  995. int foldercount = 0;
  996. g_OutlookBararray.RemoveAll();
  997. g_OutlookBararray.SetSize(15, 0);
  998. g_OutlookBararray.ElementAt(0).Add("门市流程");
  999. g_OutlookBararray.ElementAt(0).Add("开单");
  1000. g_OutlookBararray.ElementAt(0).Add("拍照");
  1001. g_OutlookBararray.ElementAt(0).Add("修片");
  1002. g_OutlookBararray.ElementAt(0).Add("选片");
  1003. g_OutlookBararray.ElementAt(0).Add("精修");
  1004. g_OutlookBararray.ElementAt(0).Add("设计");
  1005. g_OutlookBararray.ElementAt(0).Add("刻盘");
  1006. g_OutlookBararray.ElementAt(0).Add("相片冲印");
  1007. g_OutlookBararray.ElementAt(0).Add("发片/取件");
  1008. g_OutlookBararray.ElementAt(0).Add("数码安排");
  1009. g_OutlookBararray.ElementAt(1).Add("财务管理");
  1010. g_OutlookBararray.ElementAt(1).Add("订单收款");
  1011. g_OutlookBararray.ElementAt(1).Add("其它二销");
  1012. g_OutlookBararray.ElementAt(1).Add("现金支出");
  1013. g_OutlookBararray.ElementAt(1).Add("其它收入");
  1014. g_OutlookBararray.ElementAt(1).Add("提成比例");
  1015. // g_OutlookBararray.ElementAt (1).Add ("员工工作");
  1016. g_OutlookBararray.ElementAt(1).Add("计件提成"); // Jeff
  1017. g_OutlookBararray.ElementAt(1).Add("工资管理");
  1018. g_OutlookBararray.ElementAt(1).Add("员工奖罚");
  1019. g_OutlookBararray.ElementAt(2).Add("统计查询");
  1020. g_OutlookBararray.ElementAt(2).Add("日财务表");
  1021. g_OutlookBararray.ElementAt(2).Add("月财务表");
  1022. g_OutlookBararray.ElementAt(2).Add("年财务表");
  1023. g_OutlookBararray.ElementAt(2).Add("年财务图表");
  1024. g_OutlookBararray.ElementAt(2).Add("订单图表");
  1025. g_OutlookBararray.ElementAt(2).Add("成本核算");
  1026. g_OutlookBararray.ElementAt(2).Add("工资报表");
  1027. g_OutlookBararray.ElementAt(2).Add("员工业绩");
  1028. g_OutlookBararray.ElementAt(2).Add("员工资料");
  1029. g_OutlookBararray.ElementAt(2).Add("员工奖惩");
  1030. g_OutlookBararray.ElementAt(2).Add("客户区域");
  1031. // g_OutlookBararray.ElementAt (3).Add (" 短信群发 "); //// 2014.05.19 Jeff
  1032. g_OutlookBararray.ElementAt(3).Add(" 短信管理 "); //// 2014.05.19 Jeff
  1033. g_OutlookBararray.ElementAt(3).Add("短信群发");
  1034. g_OutlookBararray.ElementAt(3).Add("短信发送");
  1035. g_OutlookBararray.ElementAt(3).Add("流程短信");
  1036. g_OutlookBararray.ElementAt(3).Add("员工短信");
  1037. g_OutlookBararray.ElementAt(3).Add("发送记录");
  1038. g_OutlookBararray.ElementAt(3).Add("短信设置");
  1039. g_OutlookBararray.ElementAt(4).Add("会员管理");
  1040. g_OutlookBararray.ElementAt(4).Add("金卡会员");
  1041. g_OutlookBararray.ElementAt(4).Add("现金子卡");
  1042. g_OutlookBararray.ElementAt(4).Add("金卡图表");
  1043. g_OutlookBararray.ElementAt(4).Add("积分短信");
  1044. g_OutlookBararray.ElementAt(4).Add("蓝钻会员");
  1045. g_OutlookBararray.ElementAt(4).Add("转介绍返现");
  1046. g_OutlookBararray.ElementAt(4).Add("转介绍图表");
  1047. g_OutlookBararray.ElementAt(4).Add("积分设置");
  1048. g_OutlookBararray.ElementAt(5).Add("礼服管理");
  1049. g_OutlookBararray.ElementAt(5).Add("礼服录入");
  1050. g_OutlookBararray.ElementAt(5).Add("礼服查看");
  1051. g_OutlookBararray.ElementAt(5).Add("礼服出租");
  1052. g_OutlookBararray.ElementAt(5).Add("撞期预警");
  1053. g_OutlookBararray.ElementAt(5).Add("礼服图片");
  1054. g_OutlookBararray.ElementAt(6).Add("库存管理");
  1055. g_OutlookBararray.ElementAt(6).Add("入库单");
  1056. g_OutlookBararray.ElementAt(6).Add("出库单");
  1057. g_OutlookBararray.ElementAt(6).Add("库存查询");
  1058. g_OutlookBararray.ElementAt(6).Add("商品图表");
  1059. g_OutlookBararray.ElementAt(6).Add("固定资产管理");
  1060. g_OutlookBararray.ElementAt(7).Add("客户管理");
  1061. g_OutlookBararray.ElementAt(7).Add("订单客户");
  1062. g_OutlookBararray.ElementAt(7).Add("老客户");
  1063. g_OutlookBararray.ElementAt(7).Add("意向客户");
  1064. g_OutlookBararray.ElementAt(7).Add("客户流失");
  1065. g_OutlookBararray.ElementAt(7).Add("客户来源");
  1066. g_OutlookBararray.ElementAt(8).Add("来电精灵");
  1067. g_OutlookBararray.ElementAt(8).Add("客户来电");
  1068. g_OutlookBararray.ElementAt(8).Add("拨出电话");
  1069. g_OutlookBararray.ElementAt(8).Add("未接来电");
  1070. g_OutlookBararray.ElementAt(9).Add("员工考勤");
  1071. g_OutlookBararray.ElementAt(9).Add("考勤记录");
  1072. g_OutlookBararray.ElementAt(9).Add("月统计");
  1073. g_OutlookBararray.ElementAt(9).Add("时间设置");
  1074. g_OutlookBararray.ElementAt(9).Add("排班设置");
  1075. g_OutlookBararray.ElementAt(10).Add("客户服务");
  1076. g_OutlookBararray.ElementAt(10).Add("满意度");
  1077. g_OutlookBararray.ElementAt(10).Add("满意度汇总");
  1078. #if JEFF_DELETE_ON // 2014.11.14-PM 16:20
  1079. g_OutlookBararray.ElementAt(10).Add("回复统计");
  1080. #endif
  1081. g_OutlookBararray.ElementAt(11).Add(_T("微信公众号"));
  1082. g_OutlookBararray.ElementAt(11).Add(_T("公众号设置"));
  1083. g_OutlookBararray.ElementAt(11).Add(_T("模板消息设置"));
  1084. g_OutlookBararray.ElementAt(11).Add(_T("推送记录"));
  1085. BOOL bHospital = 0;
  1086. if (g_cominfoarray.GetSize())
  1087. {
  1088. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
  1089. {
  1090. bHospital = 1;
  1091. }
  1092. }
  1093. if (bHospital)
  1094. {
  1095. g_OutlookBararray.ElementAt(12).Add("医院跟踪系统");
  1096. g_OutlookBararray.ElementAt(12).Add("意向查询");
  1097. g_OutlookBararray.ElementAt(12).Add("意向单录入");
  1098. g_OutlookBararray.ElementAt(12).Add("今日提醒");
  1099. g_OutlookBararray.ElementAt(12).Add("跟踪短信");
  1100. g_OutlookBararray.ElementAt(12).Add("资料设置");
  1101. }
  1102. for (int i = 0; i < 15; i++)
  1103. {
  1104. while (g_OutlookBararray.ElementAt(i).GetSize() < 20)
  1105. g_OutlookBararray.ElementAt(i).Add("");
  1106. }
  1107. CString m_rights = g_user.rights2;
  1108. //printf("Jeff:用户权限=%s\n\n",m_rights);
  1109. int nItem = 0;
  1110. CString str;
  1111. int itemcount = g_nDrawerCount; // 侧边栏数量;
  1112. if (bHospital)itemcount++;
  1113. for (int a = 0; a < itemcount; a++)
  1114. {
  1115. for (int b = 0; b < 20; b++)
  1116. {
  1117. str = g_OutlookBararray.ElementAt(a).ElementAt(b);
  1118. if (str.IsEmpty())break;
  1119. if (b == 0)
  1120. {
  1121. if (IsHasRightsHead(m_rights, str))
  1122. {
  1123. iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
  1124. }
  1125. else
  1126. break;
  1127. }
  1128. else
  1129. {
  1130. if (IsHasRightsItem(m_rights, g_OutlookBararray.ElementAt(a).ElementAt(0), str))
  1131. {
  1132. m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
  1133. }
  1134. }
  1135. }
  1136. }
  1137. // We want to receive notification messages.
  1138. m_wndOutlookBar.SetOwner(this);
  1139. m_wndOutlookBar.SetSelFolder(0);
  1140. }