Пример #1
0
        /// <summary>
        /// Shows item search dialog
        /// </summary>
        public IEnumerable <ItemModel> ShowItemSearchDialog(bool multiselect)
        {
            ModalDialog modalDialog = new ModalDialog();

            if (_parentWindow != null)
            {
                modalDialog.Owner = _parentWindow;
            }

            ItemSearchView itemSearchView = new ItemSearchView();

            modalDialog.WindowTitle  = "Search Items";
            modalDialog.Body         = itemSearchView;
            modalDialog.Confirmation = itemSearchView.ViewModel;

            ShowDialog(modalDialog);

            return(modalDialog.Result == true ? itemSearchView.ViewModel.SelectedItems : Enumerable.Empty <ItemModel>());
        }
Пример #2
0
        public void LoadItemSearch(int searchKey)
        {
            PosContext.Instance.KeysByControl.Clear();

            object leftView = _regionManager.Regions[Regions.LeftMenuRegion].GetView("ActiveView");

            if (leftView != null)
            {
                _regionManager.Regions[Regions.LeftMenuRegion].Remove(leftView);
            }


            object rightView = _regionManager.Regions[Regions.RightMenuRegion].GetView("ActiveView");

            if (rightView != null)
            {
                _regionManager.Regions[Regions.RightMenuRegion].Remove(rightView);
            }

            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);
            }

            ItemSearchView itemSearchView = _container.Resolve <ItemSearchView>("ItemSearch");

            itemSearchView.SearchKey = SearchBy.Description;

            _regionManager.Regions[Regions.LogRegion].Add(itemSearchView, "ActiveView");
            itemSearchView.LoadControls();

            object viewBottom = _regionManager.Regions[Regions.NavigatorRegion].GetView("ActiveView");

            if (viewBottom != null)
            {
                _regionManager.Regions[Regions.NavigatorRegion].Remove(viewBottom);
            }

            BottomMenuView bottomMenu = _container.Resolve <BottomMenuView>("995");

            _regionManager.Regions[Regions.NavigatorRegion].Add(bottomMenu, "ActiveView");
            bottomMenu.LoadControls();


            // BottomMenuView bottomMenu = _container.Resolve<BottomMenuView>();
            // bottomMenu.LoadControls();

            //PosContext.Instance.Receipt.OperDisplayTotals = (PosTicketTotal)keyPad;
            //PosContext.Instance.Receipt.Update(PosContext.Instance.EjCustomer);

            //InvoiceTotalView invTot = _container.Resolve<InvoiceTotalView>();
            //invTot.LoadControls();
        }
Пример #3
0
        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);
        }