53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using EnvelopeGenerator.Common;
|
|
using EnvelopeGenerator.Web.Models;
|
|
using EnvelopeGenerator.Web.Services;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Diagnostics;
|
|
|
|
namespace EnvelopeGenerator.Web.Controllers
|
|
{
|
|
public class HomeController : BaseController
|
|
{
|
|
private readonly EnvelopeService _envelopeService;
|
|
|
|
public HomeController(DatabaseService database, LoggingService logging, EnvelopeService envelopeService): base(database, logging)
|
|
{
|
|
_envelopeService = envelopeService;
|
|
}
|
|
|
|
[HttpGet]
|
|
[Route("/")]
|
|
public IActionResult Index()
|
|
{
|
|
var receiverId = 1;
|
|
List<Envelope> envelopes = _envelopeService.LoadEnvelopes(receiverId);
|
|
|
|
return View(envelopes);
|
|
}
|
|
|
|
[HttpGet]
|
|
[Route("/EnvelopeKey/{EnvelopeReceiverId}")]
|
|
public IActionResult ShowEnvelope()
|
|
{
|
|
ViewData["EnvelopeKey"] = HttpContext.Request.RouteValues["EnvelopeReceiverId"];
|
|
|
|
return View();
|
|
}
|
|
|
|
[HttpGet]
|
|
[Route("/EnvelopeKey/{EnvelopeReceiverId}/Success")]
|
|
public IActionResult EnvelopeSigned()
|
|
{
|
|
ViewData["EnvelopeKey"] = HttpContext.Request.RouteValues["EnvelopeReceiverId"];
|
|
|
|
return View();
|
|
}
|
|
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
public IActionResult Error()
|
|
{
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
}
|
|
}
|
|
} |