public void InitDisplay()
        {
            //    this.progressView.CloseDialog();

            PosContext.Instance.KeysByControl.Clear();
            //_container.
            OneLineView oneLine = _container.Resolve <OneLineView>();

            _regionManager.Regions[Regions.OperatorPromptRegion].Add(oneLine);
            PosContext.Instance.PosPrompt = oneLine;
            // PosContext.Instance.Operprompt = oneLine;

            //  LeftMenuView leftMenu = _container.Resolve<LeftMenuView>(PosContext.Instance.Parameters.getParam("HomeLeftPanelNo"));
            //  _regionManager.Regions[Regions.LeftMenuRegion].Add(leftMenu, "ActiveView");
            //  leftMenu.LoadControls();

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

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

            InvoiceView invView = _container.Resolve <InvoiceView>();

            _container.RegisterInstance <InvoiceView>(invView);
            PosContext.Instance.ReceiptDetails = invView;
            _regionManager.Regions[Regions.InvoiceRegion].Add(invView, "ActiveView");

            InvoiceTotalView invTotalView = _container.Resolve <InvoiceTotalView>();

            PosContext.Instance.ReceiptTotal = invTotalView;
            _container.RegisterInstance <InvoiceTotalView>("InvoiceTotalView", invTotalView);
            _regionManager.Regions[Regions.InvoiceTotalRegion].Add(invTotalView, "ActiveView");
            //invTotalView.LoadControls();



            KeyPadView keyPadView = _container.Resolve <KeyPadView>("KeyPadView");

            _regionManager.Regions[Regions.KeyPadRegion].Add(keyPadView, "ActiveView");
            keyPadView.LoadControls();



            InvoiceHeaderView invHeaderView = _container.Resolve <InvoiceHeaderView>();

            PosContext.Instance.ReceiptHeader = invHeaderView;
            _regionManager.Regions[Regions.InvoiceHeaderRegion].Add(invHeaderView);


            ItemGroupView itemGroupView = _container.Resolve <ItemGroupView>();

            _regionManager.Regions[Regions.LeftMenuRegion].Add(itemGroupView, "ActiveView");
            itemGroupView.AddPosKeys(1, "Item Groups");


            PosContext.Instance.PosInit("Logon");
        }
        public void LoadCustomerSearch()
        {
            PosContext.Instance.KeysByControl.Clear();

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

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

            CustomerSearchView customerSearchView = _container.Resolve <CustomerSearchView>("CustomerSearch");

            _regionManager.Regions[Regions.LeftMenuRegion].Add(customerSearchView, "ActiveView");
            customerSearchView.LoadControls();

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

            bottomMenu.LoadControls();

            object view1 = _regionManager.Regions[Regions.KeyPadRegion].GetView("ActiveView");

            if (view1 != null)
            {
                _regionManager.Regions[Regions.KeyPadRegion].Remove(view1);
            }

            KeyPadView keyPad = _container.Resolve <KeyPadView>("KeyPadView");

            _regionManager.Regions[Regions.KeyPadRegion].Add(keyPad, "ActiveView");
            keyPad.LoadControls();
            PosContext.Instance.Receipt.OperDisplayTotals = (PosTicketTotal)keyPad;


            InvoiceTotalView invTot = _container.Resolve <InvoiceTotalView>();
            //invTot.LoadControls();
        }
Esempio n. 3
0
        public void LookupFunction(ItemLookupDeviceFunctions key)
        {
            switch (key)
            {
            case ItemLookupDeviceFunctions.MoveCurrentToNext:

                BindingListCollectionView view1 = CollectionViewSource.GetDefaultView(itemDataSet.Tables[0].DefaultView) as BindingListCollectionView;
                view1.MoveCurrentToNext();
                this.itemSerchListView.ScrollIntoView(this.itemSerchListView.Items.CurrentItem);

                break;

            case ItemLookupDeviceFunctions.MoveCurrentToFirst:

                BindingListCollectionView view2 = CollectionViewSource.GetDefaultView(itemDataSet.Tables[0].DefaultView) as BindingListCollectionView;
                view2.MoveCurrentToFirst();
                this.itemSerchListView.ScrollIntoView(this.itemSerchListView.Items.CurrentItem);

                break;

            case ItemLookupDeviceFunctions.MoveCurrentToLast:

                BindingListCollectionView view3 = CollectionViewSource.GetDefaultView(itemDataSet.Tables[0].DefaultView) as BindingListCollectionView;
                view3.MoveCurrentToLast();
                this.itemSerchListView.ScrollIntoView(this.itemSerchListView.Items.CurrentItem);
                break;

            case ItemLookupDeviceFunctions.Cancel:
                /* this.Clear();
                 * PosContext.Instance.CurrentPosDisplay.LoadMenu((int)POSMenu.ItemLookupSeletion);
                 *
                 * */break;

            case ItemLookupDeviceFunctions.Select:
                PosContext.Instance.InputLine = this.SelectedItem();
                new EnterKey().Engage(0);
                break;

            case ItemLookupDeviceFunctions.MoveCurrentToPrevious:

                BindingListCollectionView view4 = CollectionViewSource.GetDefaultView(itemDataSet.Tables[0].DefaultView) as BindingListCollectionView;
                view4.MoveCurrentToPrevious();
                this.itemSerchListView.ScrollIntoView(this.itemSerchListView.Items.CurrentItem);

                break;

            case ItemLookupDeviceFunctions.Find:
                // if (PosContext.Instance.InputLine.Trim().Length > 0)
                //  {
                this.LoadItemByDescription("%" + PosContext.Instance.InputLine + "%");
                PosContext.Instance.ClearInput();
                PosContext.Instance.Operprompt.Clear();
                // }
                break;

            case ItemLookupDeviceFunctions.Clear:
                PosContext.Instance.ClearInput();
                PosContext.Instance.Operprompt.Clear();
                break;

            case ItemLookupDeviceFunctions.ItemDetails:

                PosContext.Instance.KeysByControl.Clear();

                object view = _regionManager.Regions[Regions.LogRegion].GetView("ActiveView");
                if (view != null)
                {
                    _regionManager.Regions[Regions.LogRegion].Remove(view);
                }

                ItemView itemView = _container.Resolve <ItemView>();
                _regionManager.Regions[Regions.LogRegion].Add(itemView, "ActiveView");
                itemView.SetDataContext(itemDataSet.Tables[0].DefaultView);
                itemView.LoadControls();

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

                BottomMenuView bottomMenu = _container.Resolve <BottomMenuView>("996");
                _regionManager.Regions[Regions.NavigatorRegion].Add(bottomMenu, "ActiveView");
                bottomMenu.LoadControls();

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


                KeyPadView keyPad = _container.Resolve <KeyPadView>();
                keyPad.LoadControls();

                //InvoiceTotalView invTot = _container.Resolve<InvoiceTotalView>();
                //invTot.LoadControls();


                break;

            case ItemLookupDeviceFunctions.CancelFromItemDetails:

                PosContext.Instance.KeysByControl.Clear();

                object view9 = _regionManager.Regions[Regions.LogRegion].GetView("ActiveView");
                if (view9 != null)
                {
                    _regionManager.Regions[Regions.LogRegion].Remove(view9);
                }

                ItemSearchView itemSearchView = _container.Resolve <ItemSearchView>("ItemSearch");
                _regionManager.Regions[Regions.LogRegion].Add(itemSearchView, "ActiveView");
                itemSearchView.LoadControls();

                // BottomMenuView bottomMenu9 = _container.Resolve<BottomMenuView>();
                // bottomMenu9.LoadControls();
                object viewBottom9 = _regionManager.Regions[Regions.NavigatorRegion].GetView("ActiveView");
                if (viewBottom9 != null)
                {
                    _regionManager.Regions[Regions.NavigatorRegion].Remove(viewBottom9);
                }

                BottomMenuView bottomMenu1 = _container.Resolve <BottomMenuView>("995");
                _regionManager.Regions[Regions.NavigatorRegion].Add(bottomMenu1, "ActiveView");
                bottomMenu1.LoadControls();

                KeyPadView keyPad9 = _container.Resolve <KeyPadView>();
                keyPad9.LoadControls();

                InvoiceTotalView invTot9 = _container.Resolve <InvoiceTotalView>();
                // invTot9.LoadControls();
                break;
            }
        }
        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");
        }