From b1803fbd273ed7dcdbf2ef12500f904a04f90794 Mon Sep 17 00:00:00 2001 From: jojo aquino Date: Thu, 2 Jan 2025 20:53:48 +0000 Subject: [PATCH] redirect to correct dashboard after registration --- .../Pages/Notary/Dashboard/Dashboard.cshtml | 4 ++++ .../Pages/Notary/Dashboard/Dashboard.cshtml.cs | 12 ++++++++++++ EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs | 4 +++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 EnotaryoPH/EnotaryoPH.Web/Pages/Notary/Dashboard/Dashboard.cshtml create mode 100644 EnotaryoPH/EnotaryoPH.Web/Pages/Notary/Dashboard/Dashboard.cshtml.cs diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Notary/Dashboard/Dashboard.cshtml b/EnotaryoPH/EnotaryoPH.Web/Pages/Notary/Dashboard/Dashboard.cshtml new file mode 100644 index 0000000..bb5b8bd --- /dev/null +++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Notary/Dashboard/Dashboard.cshtml @@ -0,0 +1,4 @@ +@page +@model EnotaryoPH.Web.Pages.Notary.Dashboard.DashboardModel +@{ +} diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Notary/Dashboard/Dashboard.cshtml.cs b/EnotaryoPH/EnotaryoPH.Web/Pages/Notary/Dashboard/Dashboard.cshtml.cs new file mode 100644 index 0000000..9c22ecb --- /dev/null +++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Notary/Dashboard/Dashboard.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace EnotaryoPH.Web.Pages.Notary.Dashboard +{ + public class DashboardModel : PageModel + { + public void OnGet() + { + } + } +} diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs b/EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs index fd95741..c08bc01 100644 --- a/EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs +++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs @@ -74,7 +74,9 @@ namespace EnotaryoPH.Web.Pages _notaryoDBContext.SaveChanges(); - return RedirectToPage("/Principal/Dashboard"); + return RoleType == "Principal" + ? Redirect("/Principal/Dashboard/Dashboard") + : Redirect("/Notary/Dashboard/Dashboard"); } [BindProperty]