Die Ansicht EnvelopeRejected (EnvelopeRejected.cshtml) wurde so entwickelt, dass sie nach Ablehnung eines Umschlags angezeigt wird. Logik hinzugefügt, um eine Umleitung zu aktivieren, nachdem ein Umschlag abgelehnt wurde.
This commit is contained in:
@@ -16,6 +16,9 @@ using Microsoft.AspNetCore.Localization;
|
||||
using System.Text.Encodings.Web;
|
||||
using EnvelopeGenerator.Web.Models;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using System.Text.RegularExpressions;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
@@ -209,6 +212,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpGet("EnvelopeKey/{envelopeReceiverId}/Success")]
|
||||
public async Task<IActionResult> EnvelopeSigned(string envelopeReceiverId)
|
||||
{
|
||||
@@ -242,6 +246,46 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpGet("EnvelopeKey/{envelopeReceiverId}/Rejected")]
|
||||
public async Task<IActionResult> EnvelopeRejected(string envelopeReceiverId)
|
||||
{
|
||||
try
|
||||
{
|
||||
envelopeReceiverId = _urlEncoder.Encode(envelopeReceiverId);
|
||||
|
||||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
return await _envRcvService.ReadByEnvelopeReceiverIdAsync(envelopeReceiverId).ThenAsync(
|
||||
SuccessAsync: async (er) =>
|
||||
{
|
||||
ViewData["UserCulture"] = _cultures[UserLanguage];
|
||||
return await _historyService.IsRejected(envelopeId: er.EnvelopeId)
|
||||
? View(er)
|
||||
: Redirect($"/EnvelopeKey/{envelopeReceiverId}/Locked");
|
||||
|
||||
},
|
||||
Fail: IActionResult (messages, notices) =>
|
||||
{
|
||||
_logger.LogNotice(notices);
|
||||
return this.ViewEnvelopeNotFound();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogEnvelopeError(envelopeEeceiverId: envelopeReceiverId, exception: ex);
|
||||
return this.ViewInnerServiceError();
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("EnvelopeRejected")]
|
||||
public async Task<IActionResult> Dev()
|
||||
{
|
||||
var eKey = "ZGI5M2VjOTQtY2JkNS00YWQyLTg2NDEtZTU0ZjUyMjMwOTNlOjpFREZFNDk3QjZGRENEMjUyMkZCRTdFRDg0OTQ3RUQyNDE1RTAyOUM4QkQ1RTdDOUU3RTk1MkY1MzhBNkRGRTM1";
|
||||
var er = await _envRcvService.ReadByEnvelopeReceiverIdAsync(eKey);
|
||||
ViewData["UserCulture"] = _cultures[UserLanguage];
|
||||
return View("EnvelopeRejected", er.Data);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpGet("IsAuthenticated")]
|
||||
public IActionResult IsAuthenticated()
|
||||
|
||||
Reference in New Issue
Block a user