Exemplo n.º 1
0
        public void UpdatePreambleParagraph(ResaPreambleParagraph paragraph)
        {
            using var scope = serviceScopeFactory.CreateScope();
            var resolutionService = scope.ServiceProvider.GetRequiredService <ResolutionService>();

            resolutionService.UpdatePreambleParagraph(paragraph);
            PreambleParagraphChanged?.Invoke(this, paragraph);
        }
Exemplo n.º 2
0
        public void RemovePreambleParagraph(ResaPreambleParagraph paragraph)
        {
            // Make update in database
            using var scope = serviceScopeFactory.CreateScope();
            var resolutionService = scope.ServiceProvider.GetRequiredService <ResolutionService>();

            resolutionService.RemovePreambleParagraph(paragraph);

            this.Resolution.PreambleParagraphs.Remove(paragraph);
            PreambleParagraphChanged?.Invoke(this, paragraph);
            ResolutionChanged?.Invoke(this, Resolution);
        }
Exemplo n.º 3
0
        public void MovePreambleParagraphUp(ResaPreambleParagraph paragraph)
        {
            // Make update in database
            using var scope = serviceScopeFactory.CreateScope();
            var resolutionService = scope.ServiceProvider.GetRequiredService <ResolutionService>();

            resolutionService.MovePreambleParagraphUp(paragraph);

            // Make update in exchange
            var oldIndex = this.Resolution.PreambleParagraphs.IndexOf(paragraph);

            this.Resolution.PreambleParagraphs.Swap(oldIndex, oldIndex - 1);
            PreambleParagraphChanged?.Invoke(this, paragraph);
            ResolutionChanged?.Invoke(this, Resolution);
        }