public void LoadMenu(int subMenuId) { PosContext.Instance.KeysByControl.Clear(); InvoiceTotalView invTot = _container.Resolve <InvoiceTotalView>("InvoiceTotalView"); //invTot.LoadControls(); PosContext.Instance.Receipt.OperDisplayTotals = (PosTicketTotal)invTot; KeyPadView keyPad = _container.Resolve <KeyPadView>("KeyPadView"); keyPad.LoadControls(); // object view1 = _regionManager.Regions[Regions.KeyPadRegion].GetView("ActiveView"); // if (view1 is KeyPadView ) // { // _regionManager.Regions[Regions.KeyPadRegion].Remove(view1); // _regionManager.Regions[Regions.KeyPadRegion].Add(invTot, "ActiveView"); // // } MenuConfig menus = (MenuConfig)PosContext.Instance.Config.MenuConfigs[subMenuId]; //Item Search/Table menu object tableView = _regionManager.Regions[Regions.TableRegion].GetView("ActiveView"); if (tableView != null) { _regionManager.Regions[Regions.TableRegion].Remove(tableView); } object logView = _regionManager.Regions[Regions.LogRegion].GetView("ActiveView"); if (logView != null) { _regionManager.Regions[Regions.LogRegion].Remove(logView); } //Right menu object rightView = _regionManager.Regions[Regions.RightMenuRegion].GetView("ActiveView"); if (rightView != null) { _regionManager.Regions[Regions.RightMenuRegion].Remove(rightView); } if (menus.Right_panel_id > 0) { LeftMenuView rightMenu = _container.Resolve <LeftMenuView>(menus.Right_panel_id.ToString()); _regionManager.Regions[Regions.RightMenuRegion].Add(rightMenu, "ActiveView"); } //Left menu object view = _regionManager.Regions[Regions.LeftMenuRegion].GetView("ActiveView"); if (view != null) { _regionManager.Regions[Regions.LeftMenuRegion].Remove(view); } if (menus.Left_panel_id == 994) { ItemGroupView itemMenu = _container.Resolve <ItemGroupView>("994"); _regionManager.Regions[Regions.LeftMenuRegion].Add(itemMenu, "ActiveView"); } else { LeftMenuView leftMenu = _container.Resolve <LeftMenuView>(menus.Left_panel_id.ToString()); _regionManager.Regions[Regions.LeftMenuRegion].Add(leftMenu, "ActiveView"); // leftMenu.LoadControls(); } // BottomMenuView bottomMenu = _container.Resolve<BottomMenuView>(); // bottomMenu.LoadControls(); object viewBottom = _regionManager.Regions[Regions.NavigatorRegion].GetView("ActiveView"); if (viewBottom != null) { _regionManager.Regions[Regions.NavigatorRegion].Remove(viewBottom); } BottomMenuView bottomMenu = _container.Resolve <BottomMenuView>(menus.Bottom_panel_id.ToString()); _regionManager.Regions[Regions.NavigatorRegion].Add(bottomMenu, "ActiveView"); }
private void LoadPanels() { MenuPanels menuPanels = new MenuPanels(); menuPanels.Config_no = PosSettings.Default.Configuration; DataSet panelData = menuPanels.GetMenuPanels(); try { DataTable panelTable = panelData.Tables[0]; foreach (DataRow dr in panelTable.Rows) { string panelClassName = dr["panel_class_name"].ToString(); int panelId = int.Parse(dr["panel_id"].ToString()); string panelName = dr["panel_name"].ToString(); if (panelClassName == "EclipsePos.Apps.Views.LeftMenu.LeftMenuView") { LeftMenuView leftMenu = _container.Resolve <LeftMenuView>(); leftMenu.AddPosKeys(panelId, panelName); _container.RegisterInstance <LeftMenuView>(panelId.ToString(), leftMenu); PosContext.Instance.Guis.Add(leftMenu); } if (panelClassName == "EclipsePos.Apps.Views.BottomMenu.BottomMenuView") { BottomMenuView bottomMenu = _container.Resolve <BottomMenuView>(); bottomMenu.AddPosKeys(panelId, panelName); _container.RegisterInstance <BottomMenuView>(panelId.ToString(), bottomMenu); PosContext.Instance.Guis.Add(bottomMenu); } } } catch (Exception e) { Logger.Error(this.GetType().FullName, e.StackTrace, e); } ItemSearchView itemSearchView = _container.Resolve <ItemSearchView>(); _container.RegisterInstance <ItemSearchView>("995", itemSearchView); PosContext.Instance.Guis.Add(itemSearchView); KeyPadView keyPad = _container.Resolve <KeyPadView>(); _container.RegisterInstance <KeyPadView>("KeyPadView", keyPad); PosContext.Instance.Guis.Add(keyPad); AlphaKeyView alphaKeyView = _container.Resolve <AlphaKeyView>(); _container.RegisterInstance <AlphaKeyView>("AlphaKeyView", alphaKeyView); PosContext.Instance.Guis.Add(alphaKeyView); ItemGroupView itemGroupView = _container.Resolve <ItemGroupView>(); _container.RegisterInstance <ItemGroupView>("994", itemGroupView); //PosContext.Instance.Guis.Add(itemSearchView); }