123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882 |
- // 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 (::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);
- }
- ((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);
- }
- 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();
- }
- 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;
- 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);
- g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
- RefreshOutlookBar();
- }
- 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;
- }
- 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 ( 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;
- }
- } // 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(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::RefreshOutlookBar()//初始化侧边栏;
- {
- 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("客户流失");
- g_OutlookBararray.ElementAt(foldercount).Add("客户来源");
- foldercount++;
- 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);
- }
|