Beispiel #1
0
        public async Task <IActionResult> OnGetAsync(string actionstepOrgKey, string globalxMatterId)
        {
            if (string.IsNullOrEmpty(actionstepOrgKey) || string.IsNullOrEmpty(globalxMatterId))
            {
                return(NotFound());
            }

            GlobalXMatterMapping = await _context.GlobalXMatterMappings.FindAsync(actionstepOrgKey, globalxMatterId);

            if (GlobalXMatterMapping == null)
            {
                return(NotFound());
            }

            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnPostAsync(string actionstepOrgKey, string globalxMatterId)
        {
            if (string.IsNullOrEmpty(actionstepOrgKey) || string.IsNullOrEmpty(globalxMatterId))
            {
                return(NotFound());
            }

            GlobalXMatterMapping = await _context.GlobalXMatterMappings.FindAsync(actionstepOrgKey, globalxMatterId);

            if (GlobalXMatterMapping != null)
            {
                _context.GlobalXMatterMappings.Remove(GlobalXMatterMapping);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #3
0
        public async Task <IActionResult> OnGetAsync(string actionstepOrgKey, string globalxMatterId)
        {
            if (string.IsNullOrEmpty(actionstepOrgKey) || string.IsNullOrEmpty(globalxMatterId))
            {
                return(NotFound());
            }

            GlobalXMatterMapping = await _context.GlobalXMatterMappings
                                   .AsNoTracking()
                                   .Include(m => m.CreatedBy)
                                   .Include(m => m.UpdatedBy)
                                   .FirstOrDefaultAsync(m => m.ActionstepOrgKey == actionstepOrgKey && m.GlobalXMatterId == globalxMatterId);

            if (GlobalXMatterMapping == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #4
0
        public async Task <IActionResult> OnGetAsync(string actionstepOrgKey, string globalxMatterId)
        {
            if (string.IsNullOrEmpty(actionstepOrgKey) || string.IsNullOrEmpty(globalxMatterId))
            {
                return(NotFound());
            }

            GlobalXMatterMapping = await _context.GlobalXMatterMappings
                                   .Include(m => m.CreatedBy)
                                   .Include(m => m.UpdatedBy)
                                   .FirstOrDefaultAsync(m => m.ActionstepOrgKey == actionstepOrgKey && m.GlobalXMatterId == globalxMatterId);

            if (GlobalXMatterMapping == null)
            {
                return(NotFound());
            }

            ViewData["ActionstepOrgKey"] = new SelectList(_context.ActionstepOrgs, "Key", "Key");
            return(Page());
        }
        public async Task Handle(DocumentVersionMatterIdUpdated notification, CancellationToken cancellationToken)
        {
            if (notification is null)
            {
                throw new ArgumentNullException(nameof(notification));
            }

            var mapping = await _wCADbContext.GlobalXMatterMappings.FindAsync(notification.ActionstepOrgKey, notification.OldMatterId);

            if (mapping is null)
            {
                mapping = new GlobalXMatterMapping();
                mapping.ActionstepOrgKey = notification.ActionstepOrgKey;
                mapping.GlobalXMatterId  = notification.OldMatterId;
                _wCADbContext.GlobalXMatterMappings.Add(mapping);
            }

            mapping.ActionstepMatterId = notification.NewMatterId;

            await _wCADbContext.SaveChangesAsync();
        }