-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
67 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using Microsoft.EntityFrameworkCore; | ||
using IssuerDrivingLicense.Persistence; | ||
|
||
namespace IssuerDrivingLicense | ||
namespace IssuerDrivingLicense; | ||
|
||
public class AdminModel : PageModel | ||
{ | ||
public class AdminModel : PageModel | ||
{ | ||
private readonly DrivingLicenseDbContext _context; | ||
private readonly DrivingLicenseDbContext _context; | ||
|
||
public AdminModel(DrivingLicenseDbContext context) | ||
{ | ||
_context = context; | ||
} | ||
public AdminModel(DrivingLicenseDbContext context) | ||
{ | ||
_context = context; | ||
} | ||
|
||
public List<DriverLicense> DriverLicenses { get; set; } = new List<DriverLicense>(); | ||
public List<DriverLicense> DriverLicenses { get; set; } = new List<DriverLicense>(); | ||
|
||
public async Task OnGetAsync() | ||
{ | ||
DriverLicenses = await _context.DriverLicenses.ToListAsync(); | ||
} | ||
public async Task OnGetAsync() | ||
{ | ||
DriverLicenses = await _context.DriverLicenses.ToListAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 20 additions & 21 deletions
41
IssuerDrivingLicense/Pages/DriverLicenseCredentials.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
using IssuerDrivingLicense.Persistence; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace IssuerDrivingLicense.Pages | ||
namespace IssuerDrivingLicense.Pages; | ||
|
||
public class DriverLicenseCredentialsModel : PageModel | ||
{ | ||
public class DriverLicenseCredentialsModel : PageModel | ||
{ | ||
private readonly DriverLicenseService _driverLicenseService; | ||
private readonly DriverLicenseService _driverLicenseService; | ||
|
||
public string DriverLicenseMessage { get; set; } = "Loading credentials"; | ||
public bool HasDriverLicense { get; set; } | ||
public DriverLicense? DriverLicense { get; set; } | ||
public string DriverLicenseMessage { get; set; } = "Loading credentials"; | ||
public bool HasDriverLicense { get; set; } | ||
public DriverLicense? DriverLicense { get; set; } | ||
|
||
public DriverLicenseCredentialsModel(DriverLicenseService driverLicenseService) | ||
public DriverLicenseCredentialsModel(DriverLicenseService driverLicenseService) | ||
{ | ||
_driverLicenseService = driverLicenseService; | ||
} | ||
public async Task OnGetAsync() | ||
{ | ||
DriverLicense = await _driverLicenseService.GetDriverLicense(HttpContext.User?.Identity?.Name); | ||
|
||
if (DriverLicense != null) | ||
{ | ||
_driverLicenseService = driverLicenseService; | ||
DriverLicenseMessage = "Add your driver license credentials to your wallet"; | ||
HasDriverLicense = true; | ||
} | ||
public async Task OnGetAsync() | ||
else | ||
{ | ||
DriverLicense = await _driverLicenseService.GetDriverLicense(HttpContext.User?.Identity?.Name); | ||
|
||
if (DriverLicense != null) | ||
{ | ||
DriverLicenseMessage = "Add your driver license credentials to your wallet"; | ||
HasDriverLicense = true; | ||
} | ||
else | ||
{ | ||
DriverLicenseMessage = "You have no valid driver license"; | ||
} | ||
DriverLicenseMessage = "You have no valid driver license"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace IssuerDrivingLicense.Pages | ||
namespace IssuerDrivingLicense.Pages; | ||
|
||
public class IndexModel : PageModel | ||
{ | ||
public class IndexModel : PageModel | ||
public void OnGet() | ||
{ | ||
public void OnGet() | ||
{ | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
IssuerDrivingLicense/Pages/Shared/_ValidationScriptsPartial.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script> | ||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script> | ||
@{ | ||
var nonce = this.Context.GetNonce(); | ||
} | ||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js" nonce="@nonce"></script> | ||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js" nonce="@nonce"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters