Esempio n. 1
0
        public void QuickReport(ReportFormat format)
        {
            var quickReportsViewModel = OrderQuickReportsViewModel.Create(SelectedEntity, format);

            Logger.Log(string.Format("OutlookInspiredApp: View Order Quick Report: {0}", format.ToString()));
            DocumentManagerService.CreateDocument(string.Format("Order{0}QuickReportView", format.ToString()), quickReportsViewModel, null, this).Show();
        }
Esempio n. 2
0
        IDocument CreateDocument()
        {
            var document = DocumentManagerService.CreateDocument(DocumentType.ToString() + viewNameSuffix, null, this);

            document.Title          = DocumentType;
            document.DestroyOnClose = false;
            return(document);
        }
Esempio n. 3
0
        public void ShowWindowedDocument()
        {
            IDocument document = DocumentManagerService.CreateDocument("TestView", ViewModelSource.Create(() => new TestViewModel()));

            document.Title = "WindowedDocument " + (GetTotalNumberOfDocuments() - 1);
            document.Show();
            GetServiceInfo();
        }
Esempio n. 4
0
 protected virtual IDocument CreateDocument(object parameter)
 {
     if (DocumentManagerService == null)
     {
         return(null);
     }
     return(DocumentManagerService.CreateDocument(typeof(TEntity).Name + "View", parameter, this));
 }
Esempio n. 5
0
        IDocument CreateDocument(ModuleDescription module)
        {
            var document = DocumentManagerService.CreateDocument(module.DocumentType, null, this);

            document.Title          = module.Title;
            document.DestroyOnClose = false;
            return(document);
        }
        IDocument CreateDocument(TModule module)
        {
            var document = DocumentManagerService.CreateDocument(module.DocumentType, null, this);

            document.Title          = GetModuleTitle(module);
            document.DestroyOnClose = false;
            return(document);
        }
        IDocument NavigateToDocument(TModule module)
        {
            var document = DocumentManagerService.CreateDocument(module.DocumentType, module.DocumentParameter, this);

            document.Title          = GetModuleTitle(module);
            document.Id             = module.DocumentId;
            document.DestroyOnClose = true;
            return(document);
        }
        public void OpenDocument()
        {
            var document = DocumentManagerService.CreateDocument("DocumentView", null, this);

            document.Id             = "Document" + Guid.NewGuid().ToString().Replace("-", "");
            document.DestroyOnClose = false;
            document.Title          = "Root Document";
            document.Show();
        }
Esempio n. 9
0
        public void ShowMap()
        {
            var mapViewModel = EmployeeCollectionViewModel.CreateEmployeeMapViewModel(Entity, destination => {
                Entity.Address = destination;
                this.RaisePropertyChanged(x => x.Entity);
            });

            DocumentManagerService.CreateDocument("NavigatorMapView", mapViewModel, null, this).Show();
        }
Esempio n. 10
0
        public void CreateDocument(object arg)
        {
            IDocument doc = DocumentManagerService.FindDocument(DocumentManagerService, arg);

            if (doc == null)
            {
                doc    = DocumentManagerService.CreateDocument("NewCBFView", arg);
                doc.Id = DocumentManagerService.Documents.Count <IDocument>();
            }
            doc.Show();
        }
Esempio n. 11
0
        /// <summary>
        /// 新建承包方编辑窗口
        /// </summary>
        /// <param name="model"></param>
        public void OnCreateEditCBFWindow(CBFModels model)
        {
            IDocument doc = DocumentManagerService.FindDocument(DocumentManagerService, model);

            if (doc == null)
            {
                doc    = DocumentManagerService.CreateDocument("EditCBFView", model);
                doc.Id = DocumentManagerService.Documents.Count <IDocument>();
            }
            doc.Show();
        }
Esempio n. 12
0
        public void CreateDocument(object viewModel)
        {
            var doc = DocumentManagerService.FindDocument(viewModel);

            if (doc == null)
            {
                doc    = DocumentManagerService.CreateDocument("DetailedView", viewModel);
                doc.Id = DocumentManagerService.Documents.Count();
            }
            doc.Show();
        }
 public void ShowReDelivery()
 {
     try
     {
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.ReDelivery),
                                               ReDeliveryViewModel.Create(CreateUnitOfWork(), DocumentManagerService), this, null).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(ex.Message, "Error", MessageButton.OK, MessageIcon.Error);
     }
 }
 public void RefundAction()
 {
     try
     {
         var refundAction = RefundActionCollectionViewModel.Create();
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.RefundAction), refundAction, null, this).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(ex.Message, "Error", MessageButton.OK, MessageIcon.Error);
     }
 }
Esempio n. 15
0
        protected void CreateDocument(int arg)
        {
            IDocument doc = DocumentManagerService.FindDocument(arg, this);

            if (doc == null)
            {
                doc       = DocumentManagerService.CreateDocument("EditCustomerView", arg, this);
                doc.Id    = string.Format("DocId_{0}", DocumentManagerService.Documents.Count());
                doc.Title = string.Format("Edit Customer {0}", arg);
            }
            doc.Show();
        }
Esempio n. 16
0
        public void CreateDocument(object arg)
        {
            var doc = DocumentManagerService.FindDocument(arg);

            if (doc == null)
            {
                doc    = DocumentManagerService.CreateDocument("LicenseDetailsView", arg);
                doc.Id = DocumentManagerService.Documents.Count();
            }

            doc.Show();
        }
 public void NoDeliveryReason()
 {
     try
     {
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.NoDeliveryReasonCollection),
                                               NoDeliveryReasonCollectionViewModel.Create(), null, this).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.WindowError) + ex.Message, ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }
 public void Parameter()
 {
     try
     {
         var Parameter = ParameterViewModel.Create();
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.Parameter), Parameter, null, this).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.WindowError) + ex.Message, ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }
 public void ShowRoles()
 {
     try
     {
         var RoleModel = RoleCollectionViewModel.Create();
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.Role), RoleModel, null, this).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.WindowError) + ex.Message, ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }
Esempio n. 20
0
        private void GenerateNewQueryTextEditor()
        {
            ShowSplashScreen();
            NumberOfQueries++;
            var vm       = QueryPaneViewModel.Create();
            var document = DocumentManagerService.CreateDocument("QueryPane", vm);

            document.Title          = $"Query {NumberOfQueries}";
            vm.QueryPaneName        = $"Query {NumberOfQueries}";
            document.DestroyOnClose = true;
            document.Show();
            HideSplashScreen();
        }
Esempio n. 21
0
 public void CheckListVehicle()
 {
     try
     {
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.CheckListVCollection),
                                               CheckListVehicleCollectionViewModel.Create(), null, this).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.WindowError), ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }
 public void PrintTask()
 {
     try
     {
         var UnitOfWork = UnitOfWorkFactory.CreateUnitOfWork();
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.Reporter),
                                               ReporterViewModel.Create(ReportInfoFactory.GetDeliveryReport(Entity, UnitOfWork),
                                                                        "Entrega:  " + Entity.Id), null, this).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.ReportError), ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }
        public void ShowDesigner()
        {
            var viewModel = ReportDesignerViewModel.Create(CloneReport(Report));
            var doc       = DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.ReporterDesigner), viewModel, null, this);

            doc.Title = Title;
            doc.Show();

            if (viewModel.IsReportSaved)
            {
                Report = CloneReport(viewModel.Report);
                Report.CreateDocument();
                viewModel.Report.Dispose();
            }
        }
 public void PrintProfileUser()
 {
     try
     {
         Entity.ImageOb = Entity.Image == null ? null : Convert.FromBase64String(Entity.Image);
         DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.Reporter),
                                               ReporterViewModel.Create(Entity, GetStringValue(Next.Enums.Enums.Report.Usuarios),
                                                                        "Datos completos del usuario " + Entity.Id + " " + Entity.Name, UnitOfWork), null, this).Show();
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.ReportError) + ex.Message, ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }
        public void ShowDesigner()
        {
            var viewModel = ReportDesignerViewModel.Create(CloneReport(Report));
            var doc       = DocumentManagerService.CreateDocument("ReportDesignerView", viewModel, null, this);

            doc.Title = CreateTitle();
            doc.Show();

            if (viewModel.IsReportSaved)
            {
                Report = CloneReport(viewModel.Report);
                Report.CreateDocument();
                viewModel.Report.Dispose();
            }
        }
 public void ShowServices()
 {
     try
     {
         ShowDocument(
             DocumentManagerService.CreateDocument(GetStringValue(Next.Enums.Enums.Views.ServiceCollection),
                                                   ServiceCollectionViewModel.Create(), null, this),
             GetStringValue(Next.Enums.Enums.WindowTitle.ServiceCollection));
     }
     catch (Exception ex)
     {
         MessageBoxService.ShowMessage(GetStringValue(Next.Enums.Enums.MessageError.WindowError) + ex.Message, ex.Message,
                                       MessageButton.OK, MessageIcon.Error);
     }
 }
Esempio n. 27
0
        void ShowDocument <TViewModel>(string documentType, object parameter)
        {
            var document = FindDocument <TViewModel>();

            if (parameter is long)
            {
                document = FindDocument <TViewModel>((long)parameter);
            }
            if (document == null)
            {
                document = DocumentManagerService.CreateDocument(documentType, null, parameter, this);
            }
            else
            {
                ViewModelHelper.EnsureViewModel(document.Content, this, parameter);
            }
            document.Show();
        }
Esempio n. 28
0
        public void BtnAnalyzeClick()
        {
            IsSplashScreenShown             = false;
            _selectedTestClass.ClassLibrary = SelectTestCodeDll;
            _selectedTestClass.ClassProject = SelectTestProject;

            _selectedTestClass.PartialClasses.Clear();
            _selectedTestClass.PartialClasses.Add(new ClassDetail
            {
                Claz     = _selectedTestClass.Claz,
                FilePath = _selectedTestClass.FilePath
            });

            var baseListSyntax = _selectedTestClass.Claz.Syntax.BaseList;

            if (baseListSyntax != null &&
                baseListSyntax.Types.Any())
            {
                foreach (var type in baseListSyntax.Types)
                {
                    var typeSyntax = type.Type;
                    var fileName   = typeSyntax.ToString();
                    if (typeSyntax is GenericNameSyntax syntax)
                    {
                        fileName = syntax.Identifier.ValueText;
                    }

                    var bfile = Path.GetDirectoryName(SelectTestProject)
                                .FindFile($"{fileName}.cs");
                    if (bfile?
                        .GetCodeFileContent()
                        .RootNode() is CompilationUnitSyntax baseFile)
                    {
                        _selectedTestClass.BaseClass = baseFile;
                    }
                }
            }

            if (ChkIncludePartialClasses.IsChecked)
            {
                foreach (var data in _testLookUpDataSource)
                {
                    if (!_selectedTestClass.PartialClassNodesAdded &&
                        _selectedTestClass.FullName == data.FullName &&
                        data.FilePath != _selectedTestClass.FilePath)
                    {
                        _selectedTestClass.PartialClasses.Add(data);
                    }
                }

                _selectedTestClass.PartialClassNodesAdded = true;
            }

            foreach (var data in _testLookUpDataSource)
            {
                if (_selectedTestClass.FullName == data.FullName)
                {
                    var setupMethod    = data.Claz.Syntax.NUnitSetupMethod();
                    var tearDownMethod = data.Claz.Syntax.NUnitTearDownMethod();

                    if (setupMethod != null && tearDownMethod != null)
                    {
                        _selectedTestClass.PartialClassWithSetupLogic = data;
                        break;
                    }
                }
            }

            if (_selectedTestClass.PartialClassWithSetupLogic == null &&
                _selectedTestClass.BaseClass != null)
            {
                var baseClass = _selectedTestClass.BaseClass.DescendantNodes <ClassDeclarationSyntax>()
                                .FirstOrDefault(x => x.NUnitSetupMethod() != null && x.NUnitTearDownMethod() != null);

                if (baseClass != null)
                {
                    _selectedTestClass.SetupInBaseClass           = true;
                    _selectedTestClass.PartialClassWithSetupLogic = _selectedTestClass;
                }
            }

            _selectedClass.TestClaz                  = _selectedTestClass;
            _selectedClass.ClassProject              = SelectSourceCodeProject;
            _selectedClass.ClassLibrary              = SelectSourceCodeDll;
            _selectedClass.IncludeNestedClasses      = ChkNestedClasses.IsChecked;
            _selectedClass.DoNetCoreProject          = _selectedClass.ClassProject.DoNetCoreProject();
            _selectedClass.TestClaz.DoNetCoreProject = _selectedClass.TestClaz.ClassProject.DoNetCoreProject();

            var document = DocumentManagerService.CreateDocument(
                nameof(ClassViewer),
                ClassViewerViewModel.Create(_selectedClass));

            TopMost        = false;
            document.Title = _selectedClass.FullName;
            document.Show();
        }
Esempio n. 29
0
 public void ShowMap()
 {
     DocumentManagerService.CreateDocument("MapView", null, SelectedEntity.Id, this).Show();
 }
Esempio n. 30
0
        public void QuickLetter(string templateName)
        {
            var mailMergeViewModel = MailMergeViewModel <Order, LinksViewModel> .Create(UnitOfWorkFactory, x => x.Orders, GetSelectedEntityKey(), templateName, LinksViewModel.Create());

            DocumentManagerService.CreateDocument("OrderMailMergeView", mailMergeViewModel, null, this).Show();
        }