From 64593ee4e48d8dffdef80d7c2345f927a47db7f4 Mon Sep 17 00:00:00 2001
From: DawitG96 <20013954@studenti.uniupo.it>
Date: Fri, 1 Feb 2019 01:52:06 +0100
Subject: [PATCH] - GUI
---
.gitignore | 2 +
.../Controllers/AccountController.cs | 4 +-
SeniorAssistant/Controllers/HomeController.cs | 15 +-
SeniorAssistant/Startup.cs | 10 +-
SeniorAssistant/Views/Home/Forgot.cshtml | 29 +-
SeniorAssistant/Views/Home/Login.cshtml | 88 +++-
SeniorAssistant/Views/Home/Message.cshtml | 122 ++++--
SeniorAssistant/Views/Home/Profile.cshtml | 411 +++++++++++++-----
SeniorAssistant/Views/Home/Register.cshtml | 111 ++++-
SeniorAssistant/Views/Home/User.cshtml | 186 +++++---
.../Views/Shared/Breadcrumb.cshtml | 2 +-
SeniorAssistant/Views/Shared/Logout.cshtml | 31 --
.../Views/Shared/SidebarMenu.cshtml | 7 +-
SeniorAssistant/Views/Shared/_Layout.cshtml | 35 +-
SeniorAssistant/senior.db | Bin 376832 -> 0 bytes
.../AdminLTE-2.4.3/dist/css/AdminLTE.min.css | 2 +-
.../AdminLTE-2.4.3/plugins/business.css | 39 ++
SeniorAssistant/wwwroot/logo-lg.png | Bin 0 -> 73642 bytes
.../wwwroot/uploads/alfredigno.jpg | Bin 0 -> 56265 bytes
SeniorAssistant/wwwroot/uploads/vecchio0.jpg | Bin 418141 -> 54479 bytes
20 files changed, 785 insertions(+), 309 deletions(-)
delete mode 100644 SeniorAssistant/senior.db
create mode 100644 SeniorAssistant/wwwroot/AdminLTE-2.4.3/plugins/business.css
create mode 100644 SeniorAssistant/wwwroot/logo-lg.png
create mode 100644 SeniorAssistant/wwwroot/uploads/alfredigno.jpg
diff --git a/.gitignore b/.gitignore
index 3ea5d77..5ccda99 100644
--- a/.gitignore
+++ b/.gitignore
@@ -263,3 +263,5 @@ __pycache__/
SeniorAssistant/SeniorAssistant/wwwroot/*
/SeniorAssistant/Controllers/TestController.cs
/SeniorAssistant/Views/Test/*
+/SeniorAssistant/Views/Home/Calendar.cshtml
+/SeniorAssistant/Views/Home/Calendar.cshtml.cs
diff --git a/SeniorAssistant/Controllers/AccountController.cs b/SeniorAssistant/Controllers/AccountController.cs
index be9e024..f38476e 100644
--- a/SeniorAssistant/Controllers/AccountController.cs
+++ b/SeniorAssistant/Controllers/AccountController.cs
@@ -94,12 +94,12 @@ namespace IdentityDemo.Controllers
};
return await _login(user.Username, user.Password);
}
- catch
+ catch (Exception e)
{
return Json(new JsonResponse()
{
Success = false,
- Message = UsernameDupl
+ Message = e.Message
});
}
}
diff --git a/SeniorAssistant/Controllers/HomeController.cs b/SeniorAssistant/Controllers/HomeController.cs
index 60c2bbf..8b3d461 100644
--- a/SeniorAssistant/Controllers/HomeController.cs
+++ b/SeniorAssistant/Controllers/HomeController.cs
@@ -86,16 +86,22 @@ namespace SeniorAssistant.Controllers
[Route("Forgot")]
public IActionResult Forgot(string username = "")
{
+ if (IsLogged())
+ {
+ return RedirectToAction("Profile", "Home", GetUser(HttpContext.Session.GetString(Username)));
+ }
+
var forgot = Db.Forgot.Where(f => f.Username.Equals(username)).FirstOrDefault();
- return CheckUnAuthorized("Forgot", forgot);
+ if (forgot == null)
+ return View("Login", "Utente non esiste");
+ return View("Forgot", forgot);
}
protected IActionResult CheckAuthorized(string view, object model = null)
{
if (!IsLogged())
{
- view = "Login";
- model = "/" + view;
+ return RedirectToAction("Login", "Home", "/" + view);
}
return View(view, model);
}
@@ -104,8 +110,7 @@ namespace SeniorAssistant.Controllers
{
if (IsLogged())
{
- view = "Profile";
- model = GetUser(HttpContext.Session.GetString(Username));
+ return RedirectToAction("Profile", "Home", GetUser(HttpContext.Session.GetString(Username)));
}
return View(view, model);
}
diff --git a/SeniorAssistant/Startup.cs b/SeniorAssistant/Startup.cs
index 2e5be03..138f4da 100644
--- a/SeniorAssistant/Startup.cs
+++ b/SeniorAssistant/Startup.cs
@@ -149,11 +149,11 @@ namespace SeniorAssistant
List
@Model.Question
- - - + +Se indovini la risposta allora verrai loggato. Li poi potrai modificare la password.
+Domanda di sicurezza: @Model.Question
+ + + +Se il valore del battito del paziente supera i valori che hai inserito verrai notificato
+
SeniorAssistant
+