new transaction status page
This commit is contained in:
		
							parent
							
								
									c8512b30f4
								
							
						
					
					
						commit
						365a6da48f
					
				| @ -0,0 +1,51 @@ | ||||
| @page "{Transaction_UID}" | ||||
| @model EnotaryoPH.Web.Pages.Principal.TransactionStatus.IndexModel | ||||
| @{ | ||||
| } | ||||
| 
 | ||||
| @section Head { | ||||
|     <link href="\lib\fontawesome-free-6.7.1-web\css\all.min.css" rel="stylesheet" /> | ||||
| } | ||||
| 
 | ||||
| <section class="my-5"> | ||||
|     <div class="container"> | ||||
|         <div class="row"> | ||||
|             <div class="col-xl-8"> | ||||
|                 <h1>@Model.Title</h1> | ||||
| 
 | ||||
|                 <div class="row"> | ||||
|                     <div class="col"> | ||||
|                         <p>Started on @Model.StartedOn.ToShortDateString() @Model.StartedOn.ToShortTimeString().</p> | ||||
|                         <p>@Model.StatusDescription</p> | ||||
|                         @if (Model.Signatories.Count > 0) { | ||||
|                             <div class="table-responsive"> | ||||
|                                 <table class="table"> | ||||
|                                     <thead> | ||||
|                                         <tr> | ||||
|                                             <th>Email</th> | ||||
|                                             <th>Type</th> | ||||
|                                             <th>Status</th> | ||||
|                                         </tr> | ||||
|                                     </thead> | ||||
|                                     <tbody> | ||||
|                                         @foreach(var row in Model.Signatories) | ||||
|                                         { | ||||
|                                             <tr> | ||||
|                                                 <td>@row.Email</td> | ||||
|                                                 <td>@row.Type</td> | ||||
|                                                 <td>@row.Status</td> | ||||
|                                             </tr> | ||||
|                                         } | ||||
|                                     </tbody> | ||||
|                                 </table> | ||||
|                             </div> | ||||
|                         } | ||||
| 
 | ||||
|                     </div> | ||||
|                 </div> | ||||
| 
 | ||||
|                 <div class="mt-3"><a class="btn btn-primary btn-lg" role="button" href="/"><i class="fas fa-home me-2"></i>BACK TO HOME </a></div> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
| </section> | ||||
| @ -0,0 +1,56 @@ | ||||
| using EnotaryoPH.Data; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Microsoft.AspNetCore.Mvc.RazorPages; | ||||
| 
 | ||||
| namespace EnotaryoPH.Web.Pages.Principal.TransactionStatus | ||||
| { | ||||
|     public class IndexModel : PageModel | ||||
|     { | ||||
|         private readonly NotaryoDBContext _notaryoDBContext; | ||||
|         private readonly ICurrentUserService _currentUserService; | ||||
| 
 | ||||
|         public IndexModel(NotaryoDBContext notaryoDBContext, ICurrentUserService currentUserService) | ||||
|         { | ||||
|             _notaryoDBContext = notaryoDBContext; | ||||
|             _currentUserService = currentUserService; | ||||
|         } | ||||
| 
 | ||||
|         public IActionResult OnGet() | ||||
|         { | ||||
|             var user = _notaryoDBContext.Users.First(e => e.User_UID == _currentUserService.GetUser_UID()); | ||||
|             var transaction = _notaryoDBContext | ||||
|                 .Transactions | ||||
|                 .AsNoTracking() | ||||
|                 .Include(e => e.TransactionSignatories) | ||||
|                 .Include(e => e.TransactionDocument) | ||||
|                 .FirstOrDefault(e => e.Transaction_UID == Transaction_UID && e.PrincipalID == user.UserID); | ||||
| 
 | ||||
|             if (transaction == null) | ||||
|             { | ||||
|                 return NotFound(); | ||||
|             } | ||||
| 
 | ||||
|             Title = transaction.TransactionDocument.DocumentType; | ||||
|             StartedOn = transaction.CreatedOn.GetValueOrDefault(); | ||||
|             StatusDescription = "Not all signatories have signed up to enotaryo and completed the onboarding process. This transaction cannot proceed until this has been resolved."; | ||||
| 
 | ||||
|             Signatories = transaction.TransactionSignatories.ConvertAll(s => new SignatoryViewModel | ||||
|             { | ||||
|                 Email = s.Email, | ||||
|                 Type = s.Type, | ||||
|                 Status = s.Status | ||||
|             }); | ||||
| 
 | ||||
|             return Page(); | ||||
|         } | ||||
| 
 | ||||
|         [BindProperty(SupportsGet = true)] | ||||
|         public Guid Transaction_UID { get; set; } | ||||
| 
 | ||||
|         public List<SignatoryViewModel> Signatories { get; set; } = []; | ||||
| 
 | ||||
|         public string Title { get; set; } | ||||
|         public DateTime StartedOn { get; set; } | ||||
|         public string StatusDescription { get; set; } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,9 @@ | ||||
| namespace EnotaryoPH.Web.Pages.Principal.TransactionStatus | ||||
| { | ||||
|     public class SignatoryViewModel | ||||
|     { | ||||
|         public string Email { get; set; } | ||||
|         public string Status { get; set; } | ||||
|         public string Type { get; set; } | ||||
|     } | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user