From 765fedf5cc7b2269fee39367841e89861f284c53 Mon Sep 17 00:00:00 2001 From: Mattia Romagnoli Date: Sat, 22 Oct 2022 17:32:29 +0200 Subject: [PATCH 1/2] Create alert div on insertUser with tuor fc not correct --- NationalLibrary/Controllers/HomeController.cs | 13 +++++++---- NationalLibrary/Views/Home/addUser.cshtml | 23 +++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/NationalLibrary/Controllers/HomeController.cs b/NationalLibrary/Controllers/HomeController.cs index f3c796e..e7729cf 100644 --- a/NationalLibrary/Controllers/HomeController.cs +++ b/NationalLibrary/Controllers/HomeController.cs @@ -84,9 +84,11 @@ public IActionResult router() public IActionResult addUser() { - Console.WriteLine("test"); if (userFinal == null || userFinal.Type.ToLower() == "user") - return RedirectToAction("Error"); + { + return RedirectToAction("Error"); + } + return View(); } @@ -396,7 +398,6 @@ public IActionResult insertUser(UserFinalView user) { try { - if (string.IsNullOrEmpty(user.FCRelatedTO) && (DateTime.Now - user.BirthDate).TotalDays > 6570) { DataQueries.InsertUser(user.FiscalCode, "User", user.Name, user.Surname, user.MobilePhone, user.BirthDate, user.City, user.Street, @@ -414,14 +415,16 @@ public IActionResult insertUser(UserFinalView user) } else { - return RedirectToAction("addUser"); + return RedirectToAction("addUser"); } return RedirectToAction("dashboard", userFinal); } } catch (Exception ex) { - return Error(); + ViewData["Message"] = "Il Tutore non esiste, devi prima crearlo"; + return View("addUser"); + //return Error(); } } //public static UserFinalView getUserByFiscalCode(string FiscalCode, LibraryContext ctx) diff --git a/NationalLibrary/Views/Home/addUser.cshtml b/NationalLibrary/Views/Home/addUser.cshtml index 332c850..68534e8 100644 --- a/NationalLibrary/Views/Home/addUser.cshtml +++ b/NationalLibrary/Views/Home/addUser.cshtml @@ -44,6 +44,17 @@ + @if (ViewData["Message"] != null) + { +
+ @ViewData["Message"] +
+
+ }
@@ -158,4 +169,16 @@
+ + \ No newline at end of file From db68fca98991775de467efaf627b188ca12f52b7 Mon Sep 17 00:00:00 2001 From: NicholasDevelop Date: Sat, 22 Oct 2022 17:35:37 +0200 Subject: [PATCH 2/2] Sistemata Dashboard utente --- NationalLibrary/Views/Home/userDashboard.cshtml | 2 +- NationalLibrary/wwwroot/css/dashboard.css | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/NationalLibrary/Views/Home/userDashboard.cshtml b/NationalLibrary/Views/Home/userDashboard.cshtml index 1eaaf77..623ac85 100644 --- a/NationalLibrary/Views/Home/userDashboard.cshtml +++ b/NationalLibrary/Views/Home/userDashboard.cshtml @@ -190,7 +190,7 @@ Inserisci Una Richiesta In Particolare - + diff --git a/NationalLibrary/wwwroot/css/dashboard.css b/NationalLibrary/wwwroot/css/dashboard.css index 7dd8b61..5ec6670 100644 --- a/NationalLibrary/wwwroot/css/dashboard.css +++ b/NationalLibrary/wwwroot/css/dashboard.css @@ -547,12 +547,11 @@ incoming { } .bookToAdd { - display: grid; - grid-template-rows: 10% auto auto; - align-items: center; - grid-row-gap: 30%; + display: flex; justify-content: center; - margin-top: 30px; + flex-direction: column; + padding: 0 15px; + margin-top: 110px; width: 100%; }