set the correct Notary public role

This commit is contained in:
jojo aquino 2025-04-25 21:34:42 +01:00
parent 01d98ce552
commit ce114653ed
2 changed files with 5 additions and 5 deletions

View File

@ -39,8 +39,8 @@
<div class="col">
<label class="form-label">Register As</label>
<div>
<div class="form-check form-check-inline"><input id="IsPrincipal" class="form-check-input" type="radio" name="RoleType" checked value="Principal" asp-for="RoleType" /><label class="form-check-label" for="IsPrincipal">Principal</label></div>
<div class="form-check form-check-inline"><input id="IsNotaryPublic" class="form-check-input" type="radio" name="RoleType" value="Notary Public" asp-for="RoleType" /><label class="form-check-label" for="IsNotaryPublic">Notary Public </label></div>
<div class="form-check form-check-inline"><input id="IsPrincipal" class="form-check-input" type="radio" name="RoleType" checked value="@(nameof(UserType.Principal))" asp-for="RoleType" /><label class="form-check-label" for="IsPrincipal">Principal</label></div>
<div class="form-check form-check-inline"><input id="IsNotaryPublic" class="form-check-input" type="radio" name="RoleType" value="@(nameof(UserType.Notary))" asp-for="RoleType" /><label class="form-check-label" for="IsNotaryPublic">Notary Public </label></div>
</div>
</div>
</div>

View File

@ -17,7 +17,7 @@ namespace EnotaryoPH.Web.Pages
_passwordService = passwordService;
}
public void OnGet() => RoleType = "Principal";
public void OnGet() => RoleType = nameof(UserType.Principal);
public IActionResult OnPost()
{
@ -51,7 +51,7 @@ namespace EnotaryoPH.Web.Pages
};
_notaryoDBContext.Users.Add(newUser);
if (RoleType == "Notary Public")
if (RoleType == nameof(UserType.Notary))
{
var newLawyer = new Lawyer
{
@ -75,7 +75,7 @@ namespace EnotaryoPH.Web.Pages
_notaryoDBContext.SaveChanges();
return RoleType == "Principal"
return RoleType == nameof(UserType.Principal)
? Redirect("/Principal/Dashboard/Dashboard")
: Redirect("/Notary/Dashboard/Dashboard");
}