12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580 |
- // 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;
- CString version = _T ("Version 1.0");
- AfxGetApp()->WriteProfileInt (version, "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;
- CString version = _T ("Version 1.0");
- AfxGetApp()->WriteProfileInt (version, "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);
- return CDialog::PreTranslateMessage(pMsg);
- }
- /*
- typedef struct gifImage{
- WORD lWidth;
- WORD lHeight;
- WORD width;
- WORD height;
- struct flag{
- BYTE d:3;
- BYTE c:1;
- BYTE b:3;
- BYTE a:1;
- }Flag;
- }GifImage,*PGifImage;
- #include <math.h>
- static UINT GifThread(LPVOID gifDC)
- {
- CDC* pdc = (CDC*)gifDC;
- HINSTANCE handle = ::AfxGetResourceHandle();
- HRSRC hrsrc = ::FindResource(handle,MAKEINTRESOURCE(IDR_GIF1),"GIF");
- DWORD word = ::SizeofResource(handle,hrsrc);
- BYTE* lpBy = (BYTE*)LoadResource(handle,hrsrc);
- BYTE* pByte[20];
- DWORD nu[20];
- int num = 0;
- DWORD firstLocation = 0;
- for(DWORD j=0;j<word;j++)
- {
- if(lpBy[j]==0x2c)
- {
- if(lpBy[j-1]==0x00)
- {
- if(num==0)
- {
- firstLocation = j;
- }
- PGifImage nowImage = (PGifImage)&lpBy[j+1];
- if(nowImage->Flag.a==0)
- {
- DWORD number = 1+sizeof(GifImage);
- while(lpBy[j+number]!=0)
- {
- number = number+(DWORD)lpBy[j+number]+1;
- }
- number++;
- pByte[num] = new BYTE[number];
- for(DWORD n=0;n<number;n++)
- {
- *(BYTE*)(pByte[num]+n) = lpBy[j+n];
- }
- nu[num] = number;
- j = j+number-1;
- num++;
- }
- else
- {
- int number = 1+sizeof(GifImage)+1+3*(int)floor(pow(2,nowImage->Flag.d));
- while(lpBy[j+number]!=0)
- {
- number = number+lpBy[j+number];
- }
- pByte[num] = new BYTE[number];
- for(int n=0;n<number;n++)
- {
- *(BYTE*)(pByte[num]+n) = lpBy[j+n];
- }
- nu[num] = number;
- j = j+number-1;
- num++;
- }
- }
- }
- }
- int i = 1;
- while(i)
- {
- for(int m=0;m<num;m++)
- {
- CBrush brush(RGB(255,255,255));
- pdc->FillRect(CRect(0,0,500,500),&brush);
- DWORD DDD;
- VirtualProtect(lpBy,word,PAGE_READWRITE,&DDD);
- for(DWORD n=0;n<nu[m];n++)
- {
- lpBy[firstLocation+n] = *(BYTE*)(pByte[m]+n);
- }
- VirtualProtect(lpBy,word,DDD,NULL);
-
-
-
- CMemFile file(lpBy,word);
- CArchive ar(&file,CArchive::load|CArchive::bNoFlushOnDelete);
- CArchiveStream arcstream(&ar);
- CComQIPtr<IPicture> m_picture;
- HRESULT hr = OleLoadPicture((LPSTREAM)&arcstream,0,false,IID_IPicture,(void**)&m_picture);
- long a,b;
- m_picture->get_Width(&a);
- m_picture->get_Height(&b);
- CSize sz(a,b);
- pdc->HIMETRICtoDP(&sz);
- CRect rect;
- m_picture->Render(*pdc,0,0,sz.cx,sz.cy,0,b,a,-b,&rect);
- Sleep(100);
- }
- }
- return 1;
- }
-
- CDC* m_gifDC=NULL;*/
- 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 version = _T ("Version 1.0");
- CString rights=AfxGetApp()->GetProfileString (version, "hidewindow", "");
- if(rights.IsEmpty ())rights="111111111111111";
- BOOL bHide=AfxGetApp()->GetProfileInt (version, "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
- }
- /*
- 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
-
- // 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
- // Add the first folder to the outlook bar.
- iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), 0);
-
- // 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);
- // Add the second folder to the outlook bar.
- iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), 1);
-
- // 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);
-
-
-
- iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), 2);
- // 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_ADDMEMBER
- iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), 3);
- // 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
- // Add the first folder to the outlook bar.
- iFolder = m_wndOutlookBar.AddFolder(_T("门市流程"), 0);
-
- // 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);
- // Add the second folder to the outlook bar.
- iFolder = m_wndOutlookBar.AddFolder(_T("财务管理"), 1);
-
- // 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);
- iFolder = m_wndOutlookBar.AddFolder(_T("统计查询"), 2);
-
- // 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);
-
-
- iFolder = m_wndOutlookBar.AddFolder(_T("短信群发"), 3);
- // 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);
-
- iFolder = m_wndOutlookBar.AddFolder(_T("会员管理"), 4);
- // 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);
-
- iFolder = m_wndOutlookBar.AddFolder(_T("礼服管理"), 5);
- // 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);
-
- iFolder = m_wndOutlookBar.AddFolder(_T("库存管理"), 6);
- // 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);
-
- iFolder = m_wndOutlookBar.AddFolder(_T("客户管理"), 7);
- // 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);
-
- iFolder = m_wndOutlookBar.AddFolder(_T("来电精灵"), 8);
- // 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 ADD_LOGIN
- iFolder = m_wndOutlookBar.AddFolder(_T("员工考勤"), 9);
- // 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);
- #endif
-
-
- #endif
- // Add the tree control to the outlook bar.
- //xu iFolder = m_wndOutlookBar.AddFolderBar(_T("Tree Control"), &m_wndTreeCtrl );
-
- // Set the default font used by the outlook bar.
- //xu m_wndOutlookBar.SetFontX(&xtAfxData.font);
-
- // We want to receive notification messages.
- m_wndOutlookBar.SetOwner(this);
-
- // Select the first folder in the bar.
- m_wndOutlookBar.SetSelFolder(0);
- }
- */
- 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)
- {
- m_bLoadMenu=1;m_nMenuPos=pos;
- CRect rc=m_rcarray.ElementAt (7+pos);
- 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);
-
- CString version = _T ("Version 1.0");
- BOOL checked=AfxGetApp()->GetProfileInt (version, "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(/*int*/ 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 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(BOOL bShow)
- {
- #ifndef BASIC_VERSION
- if(g_bShowBar==0 && bShow)return;
- if(g_bAllBranch)
- {
- m_bar.ShowWindow (0);
- return;
- }
-
- if(bShow)
- {
- 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);
- }
- //提成比例
- 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);
- }
- void MainFrimDlg2::RefreshOutlookBar()//初始化侧边栏;
- {
- #ifdef LYFZ_VERSION
- RefreshOutlookBarLYFZ();
- return;
- #endif
- #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 ("满意度图表");
- g_OutlookBararray.ElementAt (10).Add ("回复统计");
-
- #if 1 // 2014.07.08.文件柜
- g_OutlookBararray.ElementAt(11).Add("电子办公");
- g_OutlookBararray.ElementAt(11).Add("文件柜");
- #endif
- BOOL bHospital=0;
- if(g_cominfoarray.GetSize ())
- {
- if(atoi(g_cominfoarray.ElementAt(0).ElementAt(125)))
- {
- bHospital=1;
- }
- }
-
- if(bHospital)
- {
- #if 0
- g_OutlookBararray.ElementAt (11).Add ("医院跟踪系统");
- g_OutlookBararray.ElementAt (11).Add ("意向查询");
- g_OutlookBararray.ElementAt (11).Add ("意向单录入");
- g_OutlookBararray.ElementAt (11).Add ("今日提醒");
- g_OutlookBararray.ElementAt (11).Add ("跟踪短信");
- g_OutlookBararray.ElementAt (11).Add ("资料设置");
- #else
- 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 ("资料设置");
- #endif
- }
-
- 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=11;
- int itemcount = 12; // 2014.07.08.添加文件柜,基数变化;
- 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);
- }
|