123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275 |
- // MainFrimDlg2.cpp: implementation of the MainFrimDlg2 class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "YLGL.h"
- #include "MainFrimDlg2.h"
- #include ".\MenuBarXP\MenuXP.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction 图片欣赏
- /////////////////////////////////////////////////////////////////////
- CArray<CStringArray, CStringArray>g_OutlookBararray;
- //#include <afxpriv2.h>
- //#include <Atlbase.h>
- MainFrimDlg2::MainFrimDlg2()
- {
- m_bLoadMenu = 0;
- dataUpdateCentrer.setTodayBar(&m_bar); //add by wangwenbin for Update Centrer 2014-05-03
- }
- MainFrimDlg2::~MainFrimDlg2()
- {
- }
- void MainFrimDlg2::OnFSCommand(LPCTSTR command, LPCTSTR args)
- {
- }
- void MainFrimDlg2::Init()
- {
- g_pMainWnd2 = this;
- CString picdir = g_mainpath + "\\图片\\";
- if (g_bRedSkin)
- picdir = g_mainpath + "\\图片-红色风格\\";
- #ifdef REPL_TITLE
- if (::PathFileExists(picdir + "标题.jpg"))
- {
- Image *img = NULL;
- ::LoadImageFromBuf(&img, picdir + "标题.jpg");
- int width = img->GetWidth();
- int height = img->GetHeight();
- if (height == 87)
- {
- Graphics graph(m_pBk);
- Rect destinationRect(0, 0, width, height);
- graph.DrawImage(img, destinationRect, 0, 0, width, height, UnitPixel);
- }
- delete img;
- }
- #endif
- /* if(0)//::PathFileExists (g_mainpath+"\\zx.dll"))
- {
- HINSTANCE hinst=::LoadLibrary (g_mainpath+"\\zx.dll");
- if(hinst)
- {
- AfxSetResourceHandle(hinst);
- Image *img=NULL;
- ::LoadImageFromRes (&img, MAKEINTRESOURCE(2010), "ZX");
- AfxSetResourceHandle(AfxGetInstanceHandle());
- FreeLibrary(hinst);
- ::LoadImageFromBuf (&img, picdir+"标题.jpg");
- int width=img->GetWidth() ;
- int height=img->GetHeight() ;
- Graphics graph(m_pBk);
- Rect destinationRect(0,0,width,height);
- graph.DrawImage(img, destinationRect, 0,0,width,height,UnitPixel);
- delete img;
- }
- }
- else if(::PathFileExists (g_mainpath+"\\zwj.dll"))
- {
- HINSTANCE hinst=::LoadLibrary (g_mainpath+"\\zwj.dll");
- if(hinst)
- {
- AfxSetResourceHandle(hinst);
- Image *img=NULL;
- ::LoadImageFromRes (&img, MAKEINTRESOURCE(2010), "ZWJ");
- AfxSetResourceHandle(AfxGetInstanceHandle());
- FreeLibrary(hinst);
- ::LoadImageFromBuf (&img, picdir+"标题.jpg");
- int width=img->GetWidth() ;
- int height=img->GetHeight() ;
- Graphics graph(m_pBk);
- Rect destinationRect(0,0,width,height);
- graph.DrawImage(img, destinationRect, 0,0,width,height,UnitPixel);
- delete img;
- }
- }*/
- if (::PathFileExists(picdir + "背景.jpg"))
- {
- Image *pImg = NULL;
- ::LoadImageFromBuf(&pImg, picdir + "背景.jpg");
- if (1660 == pImg->GetWidth() && 1177 == pImg->GetHeight())
- {
- Graphics graph(m_pBk);
- CRect rc = m_rcarray.ElementAt(16);
- rc.left /= g_fscalex;
- rc.right /= g_fscalex;
- rc.top /= g_fscaley;
- rc.bottom /= g_fscaley;
- Rect destinationRect(rc.left, rc.top, rc.Width(), rc.Height());
- graph.DrawImage(pImg, destinationRect, 0, 0, pImg->GetWidth(), pImg->GetHeight(), UnitPixel);
- }
- delete pImg;
- }
- CRect rc;
- HWND wnd = ::FindWindow("Shell_TrayWnd", 0);
- ::GetWindowRect(wnd, &rc);
- int hei = rc.Height();
- rc = CRect(0, 0, g_screenwid, g_screenhei - hei);
- MoveWindow(rc);
- {
- CRgn rgn1, rgn2, rgn3;
- CRect rc = m_rcarray.ElementAt(16);
- rgn2.CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
- ::SetWindowRgn(g_pMainWnd->m_hWnd, rgn2, 0);
- }
- /* GetWindowRect(rc);
- rc.bottom -=rc.top ;
- rc.top =0;
- MoveWindow(rc);*/
- /* ((MyBmpButton2*)m_picarray.ElementAt (0))->m_bAutoFocusImg=1; //已配图
- ((MyBmpButton2*)m_picarray.ElementAt (1))->m_bAutoFocusImg=1;
- ((MyBmpButton2*)m_picarray.ElementAt (2))->m_bAutoFocusImg=1;
- ((MyBmpButton2*)m_picarray.ElementAt (3))->m_bAutoFocusImg=1;
- ((MyBmpButton2*)m_picarray.ElementAt (4))->m_bAutoFocusImg=1;
- ((MyBmpButton2*)m_picarray.ElementAt (5))->m_bAutoFocusImg=1;
- ((MyBmpButton2*)m_picarray.ElementAt (6))->m_bAutoFocusImg=1; */
- ((MyBmpButton2*)m_picarray.ElementAt(11))->m_bAutoFocusImg = 1;
- ((MyBmpButton2*)m_picarray.ElementAt(12))->m_bAutoFocusImg = 1;
- ((MyBmpButton2*)m_picarray.ElementAt(13))->m_bAutoFocusImg = 1;
- ((MyBmpButton2*)m_picarray.ElementAt(28))->m_bAutoFocusImg = 1;
- ///////////////////////flash
- rc = m_rcarray.ElementAt(16);
- rc.left = rc.right - 115;
- rc.top = rc.bottom - 35;
- ((MyBmpButton2*)m_picarray.ElementAt(17))->MoveWindow(rc);
- //////////////////////////////////
- Init2();
- rc = m_rcarray.ElementAt(16);
- CRect oldmainrc = g_rc;
- g_rc = rc;
- g_dx = g_rc.left - oldmainrc.left;
- g_dy = g_rc.top - oldmainrc.top;
- g_WidthScale = ((float)g_rc.Width()) / 722.0;
- g_HeightScale = ((float)g_rc.Height()) / 533.0;
- if (g_screenwid == 2560 && g_screenhei == 1440)
- {
- // m_WidthScale*=0.775;
- // m_HeightScale*=0.76;
- }
- if (g_screenwid == 1920 && g_screenhei == 1440)
- {
- // m_WidthScale*=0.775;
- // m_HeightScale*=0.76;
- }
- #ifndef BASIC_VERSION
- m_bar.Create(IDD_DLGtodaybar, this);
- rc = g_rc; rc.bottom = rc.top + 20;
- rc.left++;
- rc.right -= 2;
- m_bar.MoveWindow(rc);
- #endif
- }
- void MainFrimDlg2::Destory()
- {
- }
- void MainFrimDlg2::BtnClick(WPARAM wParam, LPARAM lParam)
- {
- int id = lParam;
- id -= 99;
- switch (id)
- {
- case 14:
- g_pMainWnd->OnClose2();
- break;
- case 12:
- ::SendMessage(g_pMainWnd->GetSafeHwnd(), WM_SYSCOMMAND, SC_MINIMIZE, 0);
- break;
- case 8:
- case 9:
- case 10:
- case 11:
- ShowMenu(id - 8);
- break;
- case 1:
- g_pMainWnd->OnCommandMenu(IDM_TODAY);
- break;
- case 2:
- g_pMainWnd->OnCommandMenu(IDM_DINDAN);
- break;
- case 3:
- g_pMainWnd->OnCommandMenu(IDM_TAKECONTROL);
- break;
- case 4:
- g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
- break;
- case 5:
- g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
- break;
- case 6:
- g_pMainWnd->OnCommandMenu(IDM_Daily);
- break;
- case 7:
- g_pMainWnd->OnCommandMenu(IDM_ProcessAlarm);
- break;
- break;
- case 29:
- if (g_bRedSkin)
- {
- if (AfxMessageBox("确定切换成蓝色风格界面吗?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- AfxGetApp()->WriteProfileInt(LYFZVERSION, "redskin", 0);
- AfxMessageBox("切换成功,重启软件生效!", MB_ICONINFORMATION);
- }
- else
- {
- if (0 == ::PathFileExists(g_mainpath + "\\skin\\10-red.lia"))
- {
- AfxMessageBox("红色界面包尚未安装,请通知系统管理员!", MB_ICONINFORMATION);
- ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
- return;
- }
- if (AfxMessageBox("确定切换成红色风格界面吗?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- AfxGetApp()->WriteProfileInt(LYFZVERSION, "redskin", 1);
- AfxMessageBox("切换成功,重启软件生效!", MB_ICONINFORMATION);
- }
- break;
- }
- }
- BOOL MainFrimDlg2::PreTransMsg(MSG* pMsg)
- {
- if (pMsg->message == WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_ESCAPE:
- case VK_RETURN:
- return 1;
- }
- }
- else if (pMsg->message == WM_PAINT && pMsg->hwnd == this->m_hWnd)
- {
- SetTimer(1, 100, NULL);
- // DrawLogin();
- }
- else if (pMsg->message == WM_TIMER&& pMsg->hwnd == this->m_hWnd)
- {
- KillTimer(1);
- // LOG4C((LOG_NOTICE,"DrawLogin"));
- DrawLogin();
- }
- else if (pMsg->message == WM_LBUTTONUP)
- {
- CPoint pt;
- GetCursorPos(&pt);
- ScreenToClient(&pt);
- CRect rc;
- rc = m_rcarray.ElementAt(11);
- if (rc.PtInRect(pt))
- ::SendMessage(g_pMainWnd->GetSafeHwnd(), WM_SYSCOMMAND, SC_MINIMIZE, 0);
- rc = m_rcarray.ElementAt(16);
- rc.left = rc.right - 115;
- rc.top = rc.bottom - 35;
- if (rc.PtInRect(pt))
- ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
- }
- else if (pMsg->message == WM_LBUTTONDBLCLK)
- {
- CPoint pt;
- GetCursorPos(&pt);
- ScreenToClient(&pt);
- CRect rc;
- GetClientRect(rc);
- CPoint pt2 = rc.CenterPoint();
- rc.left = pt2.x - 20;
- rc.right = pt2.x + 20;
- rc.top = pt2.y - 10;
- rc.bottom = pt2.y + 10;
- if (rc.PtInRect(pt) && g_pMainWnd->IsShiftDown() && g_pMainWnd->IsCtrlDown())
- {
- MessageBox("版权所有:惠州市利亚方舟科技有限公司\r\n电话:0752-2398865\r\n网址:www.lyfz.net");
- }
- }
- return g_pMainWnd->PreTranslateMessage(pMsg);
- }
- void MainFrimDlg2::Init2()
- {
- CRect rc = m_rcarray.ElementAt(15);
- // rc.top-=5;
- // rc.bottom-=7;
- if (!m_wndOutlookBar.Create(WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, rc, this, 0, OBS_XT_DEFAULT))
- {
- TRACE0("Failed to create outlook bar.");
- return;
- }
- // Set the background and text color of the outlook bar.
- if (g_bRedSkin)
- m_wndOutlookBar.SetBackColor(RGB(112, 29, 55));
- else
- m_wndOutlookBar.SetBackColor(RGB(70, 70, 70));
- m_wndOutlookBar.SetTextColor(RGB(0xff, 0xff, 0xff));
- // Add items to the outlook bar.
- InitializeOutlookBar();
- // CDC* pdc = GetDC();
- // m_gifDC = new CDC;
- // m_gifDC->Attach(pdc->GetSafeHdc());
- // AfxBeginThread(GifThread,(LPVOID)m_gifDC);
- }
- static UINT nIcons[] =
- {
- IDI_ICON1, IDI_ICON3, IDI_ICON4, IDI_ICON7,
- IDI_ICON8, IDI_ICON2, IDI_ICON11, IDI_ICON6,
- IDI_ICON9, IDI_ICON10, IDI_ICON5
- };
- // 初始化侧边栏;
- void MainFrimDlg2::InitializeOutlookBar()
- {
- // Create the image lists used by the outlook bar.
- m_ImageSmall.Create(16, 16, ILC_COLOR16 | ILC_MASK, 2, 1);
- m_ImageLarge.Create(32, 32, ILC_COLOR16 | ILC_MASK, 2, 1);
- // initiailize the image lists.
- for (int i = 0; i < 11; ++i)
- {
- HICON hIcon = AfxGetApp()->LoadIcon(nIcons[i]);
- ASSERT(hIcon);
- m_ImageSmall.Add(hIcon);
- m_ImageLarge.Add(hIcon);
- }
- int iFolder; // index of the added folder
- /* CString rights=AfxGetApp()->GetProfileString (LYFZVERSION, "hidewindow", "");
- if(rights.IsEmpty ())rights="111111111111111";
- BOOL bHide=AfxGetApp()->GetProfileInt (LYFZVERSION, "hidewindow2", 0);
- */
- CString rights;
- int foldercount = 0;
- // set the image lists for the outlook bar.
- m_wndOutlookBar.SetImageList(&m_ImageLarge, OBS_XT_LARGEICON);
- m_wndOutlookBar.SetImageList(&m_ImageSmall, OBS_XT_SMALLICON);
- #ifdef BASIC_VERSION
- if(IsHasRight(rights,"门市流程"))
- {
- // Add the first folder to the outlook bar.
- iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), foldercount);foldercount++;
- // Add items to the folder, syntax is folder, index, text, image, and item data.
- m_wndOutlookBar.InsertItem(iFolder, 1, _T("开单"), 0, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 2, _T("拍照"), 1, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 3, _T("修片"), 2, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 4, _T("选片"), 3, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 5, _T("精修"), 4, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 6, _T("设计"), 5, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 7, _T("刻盘"), 6, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 8, _T("发片/取件"), 7, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 9, _T("数码安排"), 8, NULL);
- }
- if(IsHasRight(rights,"财务管理"))
- {
- // Add the second folder to the outlook bar.
- iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), foldercount);foldercount++;
- // Add items to the folder, syntax is folder, index, text, image, and item data.
- m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单收款"), 0, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 2, _T("现金支出"), 1, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 3, _T("其它收入"), 2, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 4, _T("其它二销"), 3, NULL);
- // m_wndOutlookBar.InsertItem(iFolder, 5, _T("员工奖罚"), 4, NULL);
- // m_wndOutlookBar.InsertItem(iFolder, 6, _T("日财务表"), 5, NULL);
- // m_wndOutlookBar.InsertItem(iFolder, 7, _T("工资管理"), 6, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 5, _T("客人付款"), 6, NULL);
- }
- //if(IsHasRight(rights,"短信群发"))
- if(IsHasRight(rights,"短信管理"))
- {
- //iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), foldercount);foldercount++;
- iFolder = m_wndOutlookBar.AddFolder(_T("短信管理"), foldercount);foldercount++;
- // Add items to the folder, syntax is folder, index, text, image, and item data.
- m_wndOutlookBar.InsertItem(iFolder, 1, _T("短信群发"), 0, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 2, _T("短信发送"), 1, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 3, _T("流程短信"), 2, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 4, _T("员工短信"), 3, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 5, _T("发送记录"), 4, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 6, _T("短信设置"), 5, NULL);
- }
- #ifdef BASIC_ADDPHONE
- if(IsHasRight(rights,"客户管理"))
- {
- iFolder = m_wndOutlookBar.AddFolder(_T("客户管理"), foldercount);foldercount++;
- // Add items to the folder, syntax is folder, index, text, image, and item data.
- m_wndOutlookBar.InsertItem(iFolder, 1, _T("订单客户"), 0, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 2, _T("老客户"), 1, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 3, _T("意向客户"), 2, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 4, _T("客户流失"), 3, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 5, _T("客户来源"), 4, NULL);
- }
- #endif
- #ifdef BASIC_ADDDRESS
- if(IsHasRight(rights,"礼服管理"))
- {
- iFolder = m_wndOutlookBar.AddFolder(_T("礼服管理"), foldercount);foldercount++;
- // Add items to the folder, syntax is folder, index, text, image, and item data.
- m_wndOutlookBar.InsertItem(iFolder, 1, _T("礼服录入"), 0, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 2, _T("礼服查看"), 1, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 3, _T("撞期预警"), 2, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 4, _T("图片欣赏"), 3, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 5, _T("礼服出租"), 4, NULL);
- }
- #endif
- if(IsHasRight(rights,"来电精灵"))
- {
- iFolder = m_wndOutlookBar.AddFolder(_T("来电精灵"), foldercount);foldercount++;
- // Add items to the folder, syntax is folder, index, text, image, and item data.
- m_wndOutlookBar.InsertItem(iFolder, 1, _T("客户来电"), 0, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 2, _T("拨出电话"), 1, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 3, _T("未接来电"), 2, NULL);
- }
- #ifdef BASIC_ADDMEMBER
- if(IsHasRight(rights,"会员管理"))
- {
- iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), foldercount);foldercount++;
- // Add items to the folder, syntax is folder, index, text, image, and item data.
- m_wndOutlookBar.InsertItem(iFolder, 1, _T("金卡会员"), 0, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 2, _T("转介绍积分"), 1, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 3, _T("转介绍图表"), 2, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 4, _T("蓝钻会员"), 3, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 4, _T("转介绍返现"), 4, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 5, _T("转介绍图表2"), 5, NULL);
- m_wndOutlookBar.InsertItem(iFolder, 6, _T("积分设置"),6, NULL);
- }
- #endif
- #else
- g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
- RefreshOutlookBar();
- #endif
- }
- LRESULT MainFrimDlg2::OnOutbarNotify(WPARAM wParam, LPARAM lParam)
- {
- int nBarAction = (int)wParam;
- // Cast the lParam to a XT_OUTBAR_INFO* struct pointer.
- XT_OUTBAR_INFO* pOBInfo = (XT_OUTBAR_INFO*)lParam;
- ASSERT(pOBInfo);
- switch (nBarAction)
- {
- case OBN_XT_ITEMCLICK:
- {
- CString strMsg = pOBInfo->lpszText;
- g_pMainWnd->OnOutbarNotify(strMsg);
- // AfxMessageBox(strMsg);
- // TRACE2( "Item selected: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
- }
- break;
- /* case OBN_XT_FOLDERCHANGE:
- TRACE2( "Folder selected: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
- break;
- case OBN_XT_ONLABELENDEDIT:
- TRACE2( "Item edited: %d, New name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
- break;
- case OBN_XT_ONGROUPENDEDIT:
- TRACE2( "Folder edited: %d, New name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
- break;
- case OBN_XT_DRAGITEM:
- TRACE3( "Dragging From: %d, To: %d, Name: %s.\n", pOBInfo->nDragFrom, pOBInfo->nDragTo, pOBInfo->lpszText);
- break;
- case OBN_XT_ITEMHOVER:
- TRACE2( "Hovering Item: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
- break;
- case OBN_XT_DELETEITEM:
- if (!m_bDestroy && AfxMessageBox(_T("Are you sure you want to remove this folder shortcut?"),
- MB_ICONWARNING|MB_YESNO) == IDNO)
- {
- // The user selected No, return FALSE to abort the action.
- return FALSE;
- }
- TRACE2( "Item deleted: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
- break;
- case OBN_XT_DELETEFOLDER:
- if (!m_bDestroy && AfxMessageBox(_T("Are you sure you want to remove the specified folder?"),
- MB_ICONWARNING|MB_YESNO) == IDNO)
- {
- // The user selected No, return FALSE to abort the action.
- return FALSE;
- }
- TRACE2( "Folder deleted: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
- break;*/
- }
- return TRUE;
- }
- void MainFrimDlg2::SetSelFolder(int pos)
- {
- m_wndOutlookBar.SetSelFolder(pos);
- }
- void MainFrimDlg2::ShowMenu(int pos)
- {
- printf("\t\t显示菜单,第[%d]个菜单\n", pos + 1);
- m_bLoadMenu = 1;
- m_nMenuPos = pos;
- CRect rc = m_rcarray.ElementAt(7 + pos);
- 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());
- CMenuXP *pPopup;
- pPopup = new CMenuXP;
- pPopup->CYBUTTONMARGIN = 3;
- pPopup->CreatePopupMenu();
- pPopup->SetMenuStyle(CMenuXP::STYLE_XP);
- CString text;
- {
- CMenu *pMenu = g_pMainWnd->GetMenu();
- CMenu* submenu = pMenu->GetSubMenu(pos);
- BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status", 0);
- CArray<DWORD, DWORD>delidarray;
- int count = g_pMainWnd->m_Mdi.GetCount(); if (count == -1)count = 0;
- if (pos == 2)//&& count)
- {
- // submenu->DeleteMenu (65280, MF_BYCOMMAND);
- // count=submenu->GetMenuItemCount ()-2;
- count = submenu->GetMenuItemCount();
- // submenu->DeleteMenu (count-1, MF_BYPOSITION);count--;
- }
- else
- count = submenu->GetMenuItemCount();
- int i = 0;
- for (i = 0; i < count; i++)
- {
- // submenu->GetMenuString(submenu->GetMenuItemID(i), text, MF_BYCOMMAND);
- submenu->GetMenuString(i, text, MF_BYPOSITION);
- if (text.IsEmpty())
- {
- if (!(pos == 2 && i > 11))
- pPopup->AppendSeparator();
- }
- else
- {
- if (pos == 2 && i > 10)
- {
- DWORD id = submenu->GetMenuItemID(i);
- if (id > 1010)
- {
- delidarray.Add(id); continue;
- }
- // if(text.Find("查看历史数据")==-1)
- // {
- // submenu->DeleteMenu (i, MF_BYPOSITION);
- // MessageBox(str);
- // continue;
- // }
- } // CString str;
- // str.Format(":%d", submenu->GetMenuItemID(i));
- pPopup->AppendODMenu2(0, new CMenuXPText(submenu->GetMenuItemID(i), text, NULL));
- if (pos == 1 && i == 12 && checked)
- pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
- else if (pos == 1 && i == 13 && g_bStaffAchievementShow)
- pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
- else if (pos == 2 && i == 10 && g_bShowOK == 0)
- pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
- else if (pos == 2 && i > 10)
- {
- UINT status = submenu->GetMenuState(submenu->GetMenuItemID(i), MF_BYCOMMAND);
- if (status&MF_CHECKED)
- pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
- }
- else if (pos == 0 && i > 5)
- {
- UINT status = submenu->GetMenuState(submenu->GetMenuItemID(i), MF_BYCOMMAND);
- if (status&MF_CHECKED)
- pPopup->CheckMenuItem(submenu->GetMenuItemID(i), MF_BYCOMMAND | MF_CHECKED);
- }
- }
- }
- for (i = delidarray.GetSize() - 1; i >= 0; i--)
- submenu->DeleteMenu(delidarray.ElementAt(i), MF_BYCOMMAND);
- }
- rc.left += 5;
- pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, rc.left, rc.bottom, g_pMainWnd, 0);
- delete pPopup;
- }
- void MainFrimDlg2::MouseMove()
- {
- if (m_bLoadMenu)
- {
- CPoint pt;
- ::GetCursorPos(&pt);
- ScreenToClient(&pt);
- CRect rc = m_rcarray.ElementAt(7);
- CRect rc2 = m_rcarray.ElementAt(8);
- CRect rc3 = m_rcarray.ElementAt(9);
- CRect rc4 = m_rcarray.ElementAt(10);
- if (rc.PtInRect(pt) && m_nMenuPos != 0)
- {
- ShowMenu(0);
- }
- else if (rc2.PtInRect(pt) && m_nMenuPos != 1)
- {
- ShowMenu(1);
- }
- else if (rc3.PtInRect(pt) && m_nMenuPos != 2)
- {
- ShowMenu(2);
- }
- else if (rc4.PtInRect(pt) && m_nMenuPos != 3)
- {
- ShowMenu(3);
- }
- }
- }
- //extern void LoadImageFromFile(Image **img, CString path);
- extern BOOL g_bDrawLogin;
- void MainFrimDlg2::DrawLogin()
- {
- if (!g_bDrawLogin)
- return;
- CDC *pDC = GetDC();
- Graphics graph(pDC->GetSafeHdc());
- CRect rc = m_rcarray.ElementAt(14); rc.right += 60;
- RectF layoutRect(rc.left, rc.top, rc.Width(), rc.Height());
- Rect destinationRect(rc.left, rc.top, rc.Width(), rc.Height());
- if (1)
- {
- CRect rc;
- HWND wnd = ::FindWindow("Shell_TrayWnd", 0);
- ::GetWindowRect(wnd, &rc);
- int hei = rc.Height();
- rc = CRect(0, 0, g_screenwid, g_screenhei - hei);
- g_fscalex = (float)g_screenwid / 2000.0;
- g_fscaley = (float)(g_screenhei - hei) / 1400.0;
- }
- rc.left /= g_fscalex;
- rc.right /= g_fscalex;
- rc.top /= g_fscaley;
- rc.bottom /= g_fscaley;
- graph.SetSmoothingMode(SmoothingModeHighQuality);
- graph.DrawImage(m_pBk, destinationRect, rc.left, rc.top, rc.Width(), rc.Height(), UnitPixel);
- StringFormat format;
- format.SetAlignment(StringAlignmentNear);
- SolidBrush *Brush = new SolidBrush(Color(255, 255, 255, 255));
- CString str;
- if (g_user.bLongin)
- str = g_user.name + " (联机) " + g_branchname;
- else
- str = "未登录 " + g_branchname;
- if (g_bAllBranch)
- {
- if (g_user.bLongin)
- str = g_user.name + " (联机) 多店汇总";
- else
- str = "未登录 多店汇总";
- }
- int leng = GetLengthEx(str);
- BSTR bstr = str.AllocSysString();
- Gdiplus::Font *g_TimerFont;
- if (g_screenwid <= 1024)
- g_TimerFont = new Gdiplus::Font(L"黑体", 9);
- else
- g_TimerFont = new Gdiplus::Font(L"黑体", 10);
- graph.SetTextRenderingHint(TextRenderingHintAntiAlias);
- graph.DrawString(
- bstr,
- leng,
- g_TimerFont,
- layoutRect,
- &format,
- Brush);
- delete Brush;
- delete g_TimerFont;
- SysFreeString(bstr);
- ReleaseDC(pDC);
- }
- void MainFrimDlg2::UseRgn(BOOL bUse)
- {
- if (bUse == 0)
- {
- CRect rc; GetClientRect(rc);
- CRgn rgn1, rgn2, rgn3;
- rgn1.CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
- rc = m_rcarray.ElementAt(16);
- rgn2.CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
- rgn1.CombineRgn(&rgn1, &rgn2, RGN_DIFF);
- ::SetWindowRgn(m_hWnd, rgn1, 1);
- }
- else
- {
- CRect rc;
- GetClientRect(rc);
- CRgn rgn2;
- rgn2.CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
- ::SetWindowRgn(m_hWnd, rgn2, 1);
- }
- // ShowBar(bUse);
- }
- BOOL MainFrimDlg2::IsHasRight(CString rights, CString name)
- {
- return 1;
- CStringArray array;
- array.Add(_T("门市流程"));
- array.Add(_T("财务管理"));
- array.Add(_T("统计查询"));
- //array.Add(_T("短信群发"));//Jeff
- array.Add(_T("短信管理"));//Jeff
- array.Add(_T("会员管理"));
- array.Add(_T("礼服管理"));
- array.Add(_T("库存管理"));
- array.Add(_T("客户管理"));
- array.Add(_T("来电精灵"));
- array.Add(_T("员工考勤"));
- for (int i = 0; i < array.GetSize(); i++)
- {
- if (name == array.ElementAt(i))
- {
- return atoi(rights.Mid(i, 1));
- }
- }
- return 0;
- }
- void MainFrimDlg2::ShowBar(IN BOOL bShow, IN BOOL bUpgrade)
- {
- #ifndef BASIC_VERSION
- if (g_bShowBar == 0 && bShow)return;
- if (g_bAllBranch)
- {
- m_bar.ShowWindow(0);
- return;
- }
- if (bShow && bUpgrade)
- {
- m_bar.InitCtrl();
- m_bar.LinkClick("∧");
- }
- m_bar.ShowWindow(bShow);
- #endif
- }
- BOOL MainFrimDlg2::IsHasRightsHead(CString rights, CString name)
- {
- if (g_user.account == "admin")return 1;
- name = "*" + name + ";1;";
- int pos = rights.Find(name);
- if (pos == -1)return 0;
- return 1;
- }
- BOOL MainFrimDlg2::IsHasRightsItem(CString rights, CString head, CString name)
- {
- if (g_user.account == "admin")return 1;
- head = "*" + head + ";";
- int pos = rights.Find(head);
- if (pos == -1)return 0;
- rights = rights.Right(rights.GetLength() - pos - head.GetLength() - 2);
- pos = rights.Find("*");
- if (pos != -1)
- rights = rights.Left(pos);
- if (name == "开单")
- {
- if (rights.Find("预约") != -1)return 1;
- }
- if (rights.Find(name) != -1)return 1;
- return 0;
- }
- void MainFrimDlg2::EnableBtns(BOOL bEnable)
- {
- ((MyBmpButton2*)m_picarray.ElementAt(0))->EnableWindow(bEnable);
- ((MyBmpButton2*)m_picarray.ElementAt(1))->EnableWindow(bEnable);
- ((MyBmpButton2*)m_picarray.ElementAt(2))->EnableWindow(bEnable);
- ((MyBmpButton2*)m_picarray.ElementAt(3))->EnableWindow(bEnable);
- ((MyBmpButton2*)m_picarray.ElementAt(4))->EnableWindow(bEnable);
- ((MyBmpButton2*)m_picarray.ElementAt(5))->EnableWindow(bEnable);
- ((MyBmpButton2*)m_picarray.ElementAt(6))->EnableWindow(bEnable);
- ((MyBmpButton2*)m_picarray.ElementAt(0))->ReDraw();
- ((MyBmpButton2*)m_picarray.ElementAt(1))->ReDraw();
- ((MyBmpButton2*)m_picarray.ElementAt(2))->ReDraw();
- ((MyBmpButton2*)m_picarray.ElementAt(3))->ReDraw();
- ((MyBmpButton2*)m_picarray.ElementAt(4))->ReDraw();
- ((MyBmpButton2*)m_picarray.ElementAt(5))->ReDraw();
- ((MyBmpButton2*)m_picarray.ElementAt(6))->ReDraw();
- }
- void MainFrimDlg2::RefreshOutlookBar2()
- {
- #ifdef BASIC_VERSION
- return;
- #endif
- int count = m_wndOutlookBar.GetFolderCount();
- while (count--)
- m_wndOutlookBar.RemoveFolder(0);
- int iFolder; // index of the added folder
- int foldercount = 0;
- CArray<CStringArray, CStringArray>List1array;
- List1array.SetSize(15, 0);
- List1array.ElementAt(0).Add("分店汇总");
- List1array.ElementAt(0).Add("订单报表");
- List1array.ElementAt(0).Add("发片/取件");
- List1array.ElementAt(0).Add("相片冲印");
- List1array.ElementAt(0).Add("金卡会员");
- List1array.ElementAt(0).Add("现金子卡");
- List1array.ElementAt(0).Add("员工资料");
- List1array.ElementAt(1).Add("客服中心");
- List1array.ElementAt(1).Add("摄控安排");
- List1array.ElementAt(1).Add("选片预约");
- List1array.ElementAt(1).Add("看样预约");
- List1array.ElementAt(1).Add("取件预约");
- #ifndef CHILD_VERSION
- List1array.ElementAt (1).Add ("婚庆安排");
- #endif
- List1array.ElementAt(2).Add("数码中心");
- List1array.ElementAt(2).Add("拍照");
- List1array.ElementAt(2).Add("修片");
- List1array.ElementAt(2).Add("精修");
- List1array.ElementAt(2).Add("设计");
- List1array.ElementAt(2).Add("数码安排");
- for (int i = 0; i < 15; i++)
- {
- while (List1array.ElementAt(i).GetSize() < 20)
- List1array.ElementAt(i).Add("");
- }
- CString m_rights = g_user.rights2;
- int nItem = 0;
- CString str;
- for (int a = 0; a < 3; a++)
- {
- for (int b = 0; b < 20; b++)
- {
- str = List1array.ElementAt(a).ElementAt(b);
- if (str.IsEmpty())break;
- if (b == 0)
- {
- if (1)//IsHasRightsHead(m_rights, str))
- {
- iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
- }
- else
- break;
- }
- else
- {
- if (1)//IsHasRightsItem(m_rights, List1array.ElementAt (a).ElementAt (0), str))
- {
- m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
- }
- }
- }
- }
- // We want to receive notification messages.
- m_wndOutlookBar.SetOwner(this);
- m_wndOutlookBar.SetSelFolder(0);
- }
- //提成比例
- #if 0
- void MainFrimDlg2::RefreshOutlookBarLYFZ()
- {
- int count = m_wndOutlookBar.GetFolderCount();
- while (count--)
- m_wndOutlookBar.RemoveFolder(0);
- int iFolder; // index of the added folder
- int foldercount = 0;
- g_OutlookBararray.RemoveAll();
- g_OutlookBararray.SetSize(15, 0);
- g_OutlookBararray.ElementAt(foldercount).Add("客户管理");
- g_OutlookBararray.ElementAt(foldercount).Add("意向客户");
- g_OutlookBararray.ElementAt(foldercount).Add("服务记录");
- g_OutlookBararray.ElementAt(foldercount).Add("服务统计");
- g_OutlookBararray.ElementAt(foldercount).Add("每日签到");
- g_OutlookBararray.ElementAt(foldercount).Add("服务费");
- g_OutlookBararray.ElementAt(foldercount).Add("客户短信");
- g_OutlookBararray.ElementAt(foldercount).Add("满意度");
- g_OutlookBararray.ElementAt(foldercount).Add("满意度汇总");
- g_OutlookBararray.ElementAt(foldercount).Add("客户流失");
- g_OutlookBararray.ElementAt(foldercount).Add("客户来源");
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("门市流程");
- g_OutlookBararray.ElementAt(foldercount).Add("开单");
- g_OutlookBararray.ElementAt(foldercount).Add("拍照");
- g_OutlookBararray.ElementAt(foldercount).Add("修片");
- g_OutlookBararray.ElementAt(foldercount).Add("选片");
- g_OutlookBararray.ElementAt(foldercount).Add("精修");
- g_OutlookBararray.ElementAt(foldercount).Add("设计");
- g_OutlookBararray.ElementAt(foldercount).Add("刻盘");
- g_OutlookBararray.ElementAt(foldercount).Add("相片冲印");
- g_OutlookBararray.ElementAt(foldercount).Add("发片/取件");
- g_OutlookBararray.ElementAt(foldercount).Add("数码安排");
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("财务管理");
- g_OutlookBararray.ElementAt(foldercount).Add("订单收款");
- g_OutlookBararray.ElementAt(foldercount).Add("其它二销");
- g_OutlookBararray.ElementAt(foldercount).Add("现金支出");
- g_OutlookBararray.ElementAt(foldercount).Add("其它收入");
- g_OutlookBararray.ElementAt(foldercount).Add("提成比例");
- //g_OutlookBararray.ElementAt (foldercount).Add ("员工工作");
- g_OutlookBararray.ElementAt(foldercount).Add("计件提成"); // Jeff
- g_OutlookBararray.ElementAt(foldercount).Add("工资管理");
- g_OutlookBararray.ElementAt(foldercount).Add("员工奖罚");
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("统计查询");
- g_OutlookBararray.ElementAt(foldercount).Add("日财务表");
- g_OutlookBararray.ElementAt(foldercount).Add("月财务表");
- g_OutlookBararray.ElementAt(foldercount).Add("年财务表");
- g_OutlookBararray.ElementAt(foldercount).Add("年财务图表");
- g_OutlookBararray.ElementAt(foldercount).Add("订单图表");
- g_OutlookBararray.ElementAt(foldercount).Add("成本核算");
- g_OutlookBararray.ElementAt(foldercount).Add("工资报表");
- g_OutlookBararray.ElementAt(foldercount).Add("员工业绩");
- g_OutlookBararray.ElementAt(foldercount).Add("员工资料");
- g_OutlookBararray.ElementAt(foldercount).Add("员工奖惩");
- g_OutlookBararray.ElementAt(foldercount).Add("客户区域");
- foldercount++;
- // g_OutlookBararray.ElementAt (foldercount).Add (" 短信群发 ");
- g_OutlookBararray.ElementAt(foldercount).Add(" 短信管理 ");
- g_OutlookBararray.ElementAt(foldercount).Add("短信群发");
- g_OutlookBararray.ElementAt(foldercount).Add("短信发送");
- g_OutlookBararray.ElementAt(foldercount).Add("流程短信");
- g_OutlookBararray.ElementAt(foldercount).Add("员工短信");
- g_OutlookBararray.ElementAt(foldercount).Add("发送记录");
- g_OutlookBararray.ElementAt(foldercount).Add("短信设置");
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("会员管理");
- g_OutlookBararray.ElementAt(foldercount).Add("金卡会员");
- g_OutlookBararray.ElementAt(foldercount).Add("现金子卡");
- g_OutlookBararray.ElementAt(foldercount).Add("金卡图表");
- g_OutlookBararray.ElementAt(foldercount).Add("积分短信");
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("蓝钻会员");
- g_OutlookBararray.ElementAt(foldercount).Add("转介绍返现");
- g_OutlookBararray.ElementAt(foldercount).Add("转介绍图表");
- g_OutlookBararray.ElementAt(foldercount).Add("积分设置");
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("库存管理");
- g_OutlookBararray.ElementAt(foldercount).Add("入库单");
- g_OutlookBararray.ElementAt(foldercount).Add("出库单");
- g_OutlookBararray.ElementAt(foldercount).Add("库存查询");
- g_OutlookBararray.ElementAt(foldercount).Add("商品图表");
- g_OutlookBararray.ElementAt(foldercount).Add("固定资产管理");
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("来电精灵");
- g_OutlookBararray.ElementAt(foldercount).Add("客户来电");
- g_OutlookBararray.ElementAt(foldercount).Add("拨出电话");
- g_OutlookBararray.ElementAt(foldercount).Add("未接来电");
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("员工考勤");
- g_OutlookBararray.ElementAt(foldercount).Add("考勤记录");
- g_OutlookBararray.ElementAt(foldercount).Add("月统计");
- g_OutlookBararray.ElementAt(foldercount).Add("时间设置");
- g_OutlookBararray.ElementAt(foldercount).Add("排班设置");
- BOOL bHospital = 0;
- if (g_cominfoarray.GetSize())
- {
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
- {
- bHospital = 1;
- }
- }
- if (bHospital)
- {
- foldercount++;
- g_OutlookBararray.ElementAt(foldercount).Add("医院跟踪系统");
- g_OutlookBararray.ElementAt(foldercount).Add("意向查询");
- g_OutlookBararray.ElementAt(foldercount).Add("意向单录入");
- g_OutlookBararray.ElementAt(foldercount).Add("今日提醒");
- g_OutlookBararray.ElementAt(foldercount).Add("跟踪短信");
- g_OutlookBararray.ElementAt(foldercount).Add("资料设置");
- }
- for (int i = 0; i < 15; i++)
- {
- while (g_OutlookBararray.ElementAt(i).GetSize() < 20)
- g_OutlookBararray.ElementAt(i).Add("");
- }
- CString m_rights = g_user.rights2;
- int nItem = 0;
- CString str;
- int itemcount = 10;
- if (bHospital)itemcount = 11;
- for (int a = 0; a < itemcount; a++)
- {
- for (int b = 0; b < 20; b++)
- {
- str = g_OutlookBararray.ElementAt(a).ElementAt(b);
- if (str.IsEmpty())break;
- if (b == 0)
- {
- if (IsHasRightsHead(m_rights, str))
- {
- iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
- }
- else
- break;
- }
- else
- {
- if (IsHasRightsItem(m_rights, g_OutlookBararray.ElementAt(a).ElementAt(0), str))
- {
- m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
- }
- }
- }
- }
- // We want to receive notification messages.
- m_wndOutlookBar.SetOwner(this);
- m_wndOutlookBar.SetSelFolder(0);
- }
- #endif
- void MainFrimDlg2::RefreshOutlookBar()//初始化侧边栏;
- {
- #ifdef BASIC_VERSION
- return;
- #endif
- int count = m_wndOutlookBar.GetFolderCount();
- while (count--)
- m_wndOutlookBar.RemoveFolder(0);
- int iFolder; // index of the added folder
- int foldercount = 0;
- g_OutlookBararray.RemoveAll();
- g_OutlookBararray.SetSize(15, 0);
- g_OutlookBararray.ElementAt(0).Add("门市流程");
- g_OutlookBararray.ElementAt(0).Add("开单");
- g_OutlookBararray.ElementAt(0).Add("拍照");
- g_OutlookBararray.ElementAt(0).Add("修片");
- g_OutlookBararray.ElementAt(0).Add("选片");
- g_OutlookBararray.ElementAt(0).Add("精修");
- g_OutlookBararray.ElementAt(0).Add("设计");
- g_OutlookBararray.ElementAt(0).Add("刻盘");
- g_OutlookBararray.ElementAt(0).Add("相片冲印");
- g_OutlookBararray.ElementAt(0).Add("发片/取件");
- g_OutlookBararray.ElementAt(0).Add("数码安排");
- g_OutlookBararray.ElementAt(1).Add("财务管理");
- g_OutlookBararray.ElementAt(1).Add("订单收款");
- g_OutlookBararray.ElementAt(1).Add("其它二销");
- g_OutlookBararray.ElementAt(1).Add("现金支出");
- g_OutlookBararray.ElementAt(1).Add("其它收入");
- g_OutlookBararray.ElementAt(1).Add("提成比例");
- // g_OutlookBararray.ElementAt (1).Add ("员工工作");
- g_OutlookBararray.ElementAt(1).Add("计件提成"); // Jeff
- g_OutlookBararray.ElementAt(1).Add("工资管理");
- g_OutlookBararray.ElementAt(1).Add("员工奖罚");
- g_OutlookBararray.ElementAt(2).Add("统计查询");
- g_OutlookBararray.ElementAt(2).Add("日财务表");
- g_OutlookBararray.ElementAt(2).Add("月财务表");
- g_OutlookBararray.ElementAt(2).Add("年财务表");
- g_OutlookBararray.ElementAt(2).Add("年财务图表");
- g_OutlookBararray.ElementAt(2).Add("订单图表");
- g_OutlookBararray.ElementAt(2).Add("成本核算");
- g_OutlookBararray.ElementAt(2).Add("工资报表");
- g_OutlookBararray.ElementAt(2).Add("员工业绩");
- g_OutlookBararray.ElementAt(2).Add("员工资料");
- g_OutlookBararray.ElementAt(2).Add("员工奖惩");
- g_OutlookBararray.ElementAt(2).Add("客户区域");
- // g_OutlookBararray.ElementAt (3).Add (" 短信群发 "); //// 2014.05.19 Jeff
- g_OutlookBararray.ElementAt(3).Add(" 短信管理 "); //// 2014.05.19 Jeff
- g_OutlookBararray.ElementAt(3).Add("短信群发");
- g_OutlookBararray.ElementAt(3).Add("短信发送");
- g_OutlookBararray.ElementAt(3).Add("流程短信");
- g_OutlookBararray.ElementAt(3).Add("员工短信");
- g_OutlookBararray.ElementAt(3).Add("发送记录");
- g_OutlookBararray.ElementAt(3).Add("短信设置");
- g_OutlookBararray.ElementAt(4).Add("会员管理");
- g_OutlookBararray.ElementAt(4).Add("金卡会员");
- g_OutlookBararray.ElementAt(4).Add("现金子卡");
- g_OutlookBararray.ElementAt(4).Add("金卡图表");
- g_OutlookBararray.ElementAt(4).Add("积分短信");
- g_OutlookBararray.ElementAt(4).Add("蓝钻会员");
- g_OutlookBararray.ElementAt(4).Add("转介绍返现");
- g_OutlookBararray.ElementAt(4).Add("转介绍图表");
- g_OutlookBararray.ElementAt(4).Add("积分设置");
- g_OutlookBararray.ElementAt(5).Add("礼服管理");
- g_OutlookBararray.ElementAt(5).Add("礼服录入");
- g_OutlookBararray.ElementAt(5).Add("礼服查看");
- g_OutlookBararray.ElementAt(5).Add("礼服出租");
- g_OutlookBararray.ElementAt(5).Add("撞期预警");
- g_OutlookBararray.ElementAt(5).Add("礼服图片");
- g_OutlookBararray.ElementAt(6).Add("库存管理");
- g_OutlookBararray.ElementAt(6).Add("入库单");
- g_OutlookBararray.ElementAt(6).Add("出库单");
- g_OutlookBararray.ElementAt(6).Add("库存查询");
- g_OutlookBararray.ElementAt(6).Add("商品图表");
- g_OutlookBararray.ElementAt(6).Add("固定资产管理");
- g_OutlookBararray.ElementAt(7).Add("客户管理");
- g_OutlookBararray.ElementAt(7).Add("订单客户");
- g_OutlookBararray.ElementAt(7).Add("老客户");
- g_OutlookBararray.ElementAt(7).Add("意向客户");
- g_OutlookBararray.ElementAt(7).Add("客户流失");
- g_OutlookBararray.ElementAt(7).Add("客户来源");
- g_OutlookBararray.ElementAt(8).Add("来电精灵");
- g_OutlookBararray.ElementAt(8).Add("客户来电");
- g_OutlookBararray.ElementAt(8).Add("拨出电话");
- g_OutlookBararray.ElementAt(8).Add("未接来电");
- g_OutlookBararray.ElementAt(9).Add("员工考勤");
- g_OutlookBararray.ElementAt(9).Add("考勤记录");
- g_OutlookBararray.ElementAt(9).Add("月统计");
- g_OutlookBararray.ElementAt(9).Add("时间设置");
- g_OutlookBararray.ElementAt(9).Add("排班设置");
- g_OutlookBararray.ElementAt(10).Add("客户服务");
- g_OutlookBararray.ElementAt(10).Add("满意度");
- g_OutlookBararray.ElementAt(10).Add("满意度汇总");
- #if JEFF_DELETE_ON // 2014.11.14-PM 16:20
- g_OutlookBararray.ElementAt(10).Add("回复统计");
- #endif
- g_OutlookBararray.ElementAt(11).Add(_T("微信公众号"));
- g_OutlookBararray.ElementAt(11).Add(_T("公众号设置"));
- g_OutlookBararray.ElementAt(11).Add(_T("模板消息设置"));
- g_OutlookBararray.ElementAt(11).Add(_T("推送记录"));
- BOOL bHospital = 0;
- if (g_cominfoarray.GetSize())
- {
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
- {
- bHospital = 1;
- }
- }
- if (bHospital)
- {
- g_OutlookBararray.ElementAt(12).Add("医院跟踪系统");
- g_OutlookBararray.ElementAt(12).Add("意向查询");
- g_OutlookBararray.ElementAt(12).Add("意向单录入");
- g_OutlookBararray.ElementAt(12).Add("今日提醒");
- g_OutlookBararray.ElementAt(12).Add("跟踪短信");
- g_OutlookBararray.ElementAt(12).Add("资料设置");
- }
- for (int i = 0; i < 15; i++)
- {
- while (g_OutlookBararray.ElementAt(i).GetSize() < 20)
- g_OutlookBararray.ElementAt(i).Add("");
- }
- CString m_rights = g_user.rights2;
- //printf("Jeff:用户权限=%s\n\n",m_rights);
- int nItem = 0;
- CString str;
- int itemcount = g_nDrawerCount; // 侧边栏数量;
- if (bHospital)itemcount++;
- for (int a = 0; a < itemcount; a++)
- {
- for (int b = 0; b < 20; b++)
- {
- str = g_OutlookBararray.ElementAt(a).ElementAt(b);
- if (str.IsEmpty())break;
- if (b == 0)
- {
- if (IsHasRightsHead(m_rights, str))
- {
- iFolder = m_wndOutlookBar.AddFolder(str, foldercount); foldercount++;
- }
- else
- break;
- }
- else
- {
- if (IsHasRightsItem(m_rights, g_OutlookBararray.ElementAt(a).ElementAt(0), str))
- {
- m_wndOutlookBar.InsertItem(iFolder, b, str, b - 1, NULL);
- }
- }
- }
- }
- // We want to receive notification messages.
- m_wndOutlookBar.SetOwner(this);
- m_wndOutlookBar.SetSelFolder(0);
- }
|