示例#1
0
        protected override void OpenLine(ReportLineViewModel sltdLine)
        {
            var windowManager = base.GetService <IWindowManager>();

            Predicate <ViewModelBase> predicate = (ViewModelBase wsvm) =>
            {
                if (!(wsvm is OfflineSaleViewModel))
                {
                    return(false);
                }

                OfflineSaleViewModel vm = (OfflineSaleViewModel)wsvm;

                return(vm.SaleId == sltdLine.LineId);
            };

            if (windowManager.Exists(predicate))
            {
                windowManager.Activate(predicate);
            }
            else
            {
                OfflineSaleViewModel vm = new OfflineSaleViewModel(appvm, sltdLine.LineId, OnRemove, null);
                windowManager.ShowChildWindow(vm, this);
            }
        }
示例#2
0
        void Expand(SalePreViewModel saleToShow)
        {
            var windowManager = base.GetService <IWindowManager>();

            Predicate <ViewModelBase> predicate = (ViewModelBase wsvm) =>
            {
                if (!(wsvm is OfflineSaleViewModel))
                {
                    return(false);
                }

                OfflineSaleViewModel svm = (OfflineSaleViewModel)wsvm;

                return(svm.SaleId == saleToShow.SaleId);
            };

            if (windowManager.Exists(predicate))
            {
                windowManager.Activate(predicate);
            }
            else
            {
                OfflineSaleViewModel sovm = new OfflineSaleViewModel(appvm, saleToShow.SaleId, OnRemoved, OnModified);
                windowManager.ShowChildWindow(sovm, appvm);
            }
        }
示例#3
0
        void DoNewSale()
        {
            OfflineSaleViewModel saleVM = new OfflineSaleViewModel(appvm, OnCreated, DateTime.Now, DateTime.Today);

            var windowManager = base.GetService <IWindowManager>();

            windowManager.ShowChildWindow(saleVM, appvm);

            //var windowManager = base.GetService<IWindowManager>();

            //NewSaleDialogViewModel newSaleDialog = new NewSaleDialogViewModel(appvm);

            //if (windowManager.ShowDialog(newSaleDialog, appvm) == true)
            //{
            //    CreateNewVale(newSaleDialog.SelectedTable, newSaleDialog.SelectedWaiter, newSaleDialog.NumberOfPersons);
            //}
        }
示例#4
0
        void loadReportWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            pdvm.IsBusy = false;

            var windowManager = base.GetService <IWindowManager>();

            windowManager.Close(pdvm);

            if (e.Error != null)
            {
                var msgBox = base.GetService <IMessageBoxService>();
                msgBox.ShowMessage(e.Error.Message);
            }
            else
            {
                //foreach (var item in productsCreated)
                //{
                //    //appvm.ProductsOC.Add(item);
                //    //appvm.GlobalEventsManager.FireProductCreated(item);
                //}

                int saleResultId = (int)e.Result;

                using (var unitOfWork = base.GetNewUnitOfWork())
                {
                    SalePreViewModel pvm = new SalePreViewModel(unitOfWork.OrderRepository.GetById(saleResultId));

                    visibleSales.Add(pvm);
                }

                OfflineSaleViewModel vm = new OfflineSaleViewModel(appvm, saleResultId, OnRemoved, OnModified);
                windowManager.ShowChildWindow(vm, appvm);
            }

            loadReportWorker.DoWork             -= loadReportWorker_DoWork;
            loadReportWorker.ProgressChanged    -= loadReportWorker_ProgressChanged;
            loadReportWorker.RunWorkerCompleted -= loadReportWorker_RunWorkerCompleted;
            loadReportWorker = null;
        }