Commit b0a6dd21 authored by hasan khaddour's avatar hasan khaddour

fix s

parent 24914c05
......@@ -54,13 +54,13 @@ namespace WebPresentation.Controllers
if (id is null)
{
return PartialView("_PartialNotFound");
return PartialView("PartialNotFound");
}
else
{
TDto DetailDto = await _service.GetDetails((int)id);
if (DetailDto is null)
return PartialView("_PartialNotFound");
return PartialView("PartialNotFound");
TVModel model = _mapper.Map<TVModel>(DetailDto);
return View(model);
}
......@@ -73,7 +73,7 @@ namespace WebPresentation.Controllers
if (DetailDto == null)
{
return View("NotFound");
return PartialView("PartialNotFound");
}
TVModel model = _mapper.Map<TVModel>(DetailDto);
return PartialView(model);
......@@ -91,14 +91,14 @@ namespace WebPresentation.Controllers
{
if (id == null)
{
return PartialView("_PartialNotFound");
return PartialView("PartialNotFound");
}
try
{
TDto tModel = await _service.GetDetails((int)id);
if (tModel == null)
{
return PartialView("_PartialNotFound");
return PartialView("PartialNotFound");
}
TVModel model = _mapper.Map<TVModel>(tModel);
......
......@@ -43,10 +43,18 @@ namespace WebPresentation.Controllers
var t =await getCurrentPatient();
return View(t);
}
public async Task<IActionResult> Edit(int id)
{
var t = await getCurrentPatient();
if (id != t.Id) {
return View("Error");
}
return View(t);
}
public IActionResult Details(int? id ) {
return View(getCurrentPatient());
public async Task<IActionResult> Details(int? id ) {
var t = await getCurrentPatient();
return View(t);
}
......
......@@ -146,7 +146,7 @@ namespace WebPresentation
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
// app.UseStatusCodePagesWithRedirects();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
......
......@@ -53,7 +53,7 @@
</div>
<a id="forgot-password" class="small text-muted">Forgot your password?</a>
<p class="mb-5 pb-lg-2" style="color: #393f81;">
<p class="" style="color: #393f81;">
Don't have an account? <a style="color: #393f81;" asp-controller="Access" asp-action="Register" asp-route-returnUrl="@ViewBag.ReturnUrl">
Register Here
</a>
......
......@@ -2,8 +2,19 @@
@{
ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName;
ViewData["title"] = "Edit";
ViewBag.Avatar = Model.User.Avatar;
ViewData["Controller"] = "Home";
ViewBag.owner = Model;
}
<style>
......@@ -54,7 +65,8 @@
<div class="row">
<div class="col-md-3 border-right">
<div class="d-flex flex-column align-items-center text-center p-3 py-5">
<img class="rounded-circle mt-5" width="150px" src="/img/@Model.User.Avatar"><span class="font-weight-bold">@Model.User.FirstName</span><span class="text-black-50">@Model.User.Email</span><span> </span></div>
<img class="rounded-circle mt-5" width="150px" src="/img/@Model.User.Avatar"><span class="font-weight-bold">@Model.User.FirstName</span><span class="text-black-50">@Model.User.Email</span><span> </span>
</div>
</div>
<div class="col-md-5 border-right">
<div class="p-3 py-5">
......@@ -85,7 +97,7 @@
</div>
</div>
<div class="mt-5 text-center"><button class="btn btn-primary profile-button" type="button">Go Home</button></div>
<div class="mt-5 text-center"><a class="btn btn-primary profile-button" asp-action="Index">Go Home</a></div>
</div>
</div>
<div class="col-md-4">
......
......@@ -3,6 +3,21 @@
@{
ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName;
ViewData["title"] = "Edit";
ViewBag.Avatar = Model.User.Avatar;
ViewData["Controller"] = "Home";
ViewBag.owner = Model;
}
......@@ -64,15 +79,19 @@
<h4 class="text-right">Profile Settings</h4>
</div>
<div class="row mt-2">
<div class="col-md-6"><label asp-for="@Model.User.FirstName" class="labels"></label>
<input asp-for="@Model.User.FirstName" class="form-control" ></div>
<div class="col-md-6">
<label asp-for="@Model.User.FirstName" class="labels"></label>
<input asp-for="@Model.User.FirstName" class="form-control">
</div>
<div class="col-md-6"><label class="labels" asp-for="@Model.User.LastName"></label>
<input type="text" class="form-control" asp-for="@Model.User.LastName"></div>
<div class="col-md-6">
<label class="labels" asp-for="@Model.User.LastName"></label>
<input type="text" class="form-control" asp-for="@Model.User.LastName">
</div>
</div>
<div class="row mt-3">
<div class="col-md-12"><label class="labels" asp-for="@Model.BIO"></label><input type="text" class="form-control" asp-for="@Model.BIO"></div>
<div class="col-md-12"><label class="labels"asp-for="@Model.User.UserName"></label><input type="text" class="form-control" asp-for="@Model.User.UserName"></div>
<div class="col-md-12"><label class="labels" asp-for="@Model.User.UserName"></label><input type="text" class="form-control" asp-for="@Model.User.UserName"></div>
</div>
<div class="row mt-3">
<div class="col-md-12"><label class="labels" asp-for="@Model.User.Avatar"></label><input type="text" class="form-control" asp-for="@Model.User.Avatar"></div>
......
......@@ -141,8 +141,10 @@
<section class="page-section bg-primary text-white mb-0" id="topThree">
<div class="container-fluid">
<!-- Portfolio Section Heading -->
<h2 class=" text-center text-uppercase text-secondary mb-0">For more Profile Details </h2><br />
<h2 class=" text-center text-secondary mb-0" style="color :white!important ;"><a asp-action="Details" asp-controller="Home">Go to Your profile</a> </h2>
<h2 class=" text-center text-uppercase text-secondary mb-0">For Account Details : </h2><br />
<a class="btn btn-secondary" asp-action="Details" asp-controller="Home">Detail Your profile</a>
<a class="btn btn-primary" asp-action="Edit" asp-controller="Home">Edit Your profile</a>
<!-- Icon Divider -->
</div>
......
@model PatientViewModel
@{
ViewData["Title"] = "Delete";
ViewData["Controller"] = "Patients";
}
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Delete Medical Case</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<h3>Are you sure you want to delete this?</h3>
<div class="card mb-3" style="border-radius: .5rem;">
<div class="row g-0">
<div class="col-md-4 gradient-custom text-center text-black"
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;">
<img src="~/img/@Model.User.Avatar"
alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<h5>@Model.User.FirstName @Model.User.LastName</h5>
<p> @Model.User.Email</p>
</div>
<div class="col-md-8">
<div class="card-body p-4">
<h6>Information:</h6>
<hr class="mt-0 mb-4">
<div class="row pt-1">
<div class="col-6 mb-3">
<h6>BIO</h6>
<p class="text-muted">@Model.BIO</p>
</div>
<div class="col-6 mb-3">
<h6>First Access</h6>
<p class="text-muted">@Model.User.CreationTime</p>
</div>
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<button type="submit" class="m-1 btn btn-danger">Delete</button>
<button type="button" class="m-1 btn btn-secondary" data-dismiss="modal">Close</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@model PatientViewModel
@{
ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName;
Layout = "_AdminLayout";
ViewData["title"] = "Edit";
ViewBag.Avatar = Model.User.Avatar;
ViewData["Controller"] = "Patients";
ViewBag.owner = Model;
}
<style>
.form-control:focus {
box-shadow: none;
border-color: #BA68C8
}
.profile-button {
background: rgb(99, 39, 120);
box-shadow: none;
border: none
}
.profile-button:hover {
background: #682773
}
.profile-button:focus {
background: #682773;
box-shadow: none
}
.profile-button:active {
background: #682773;
box-shadow: none
}
.back:hover {
color: #682773;
cursor: pointer
}
.labels {
font-size: 11px
}
.add-experience:hover {
background: #BA68C8;
color: #fff;
cursor: pointer;
border: solid 1px #BA68C8
}
</style>
<section class="page-section">
<div class="container rounded bg-white mt-5 mb-5">
<div class="row">
<div class="col-md-3 border-right">
<div class="d-flex flex-column align-items-center text-center p-3 py-5">
<img class="rounded-circle mt-5" width="150px" src="/img/@Model.User.Avatar"><span class="font-weight-bold">@Model.User.FirstName</span><span class="text-black-50">@Model.User.Email</span><span> </span>
</div>
</div>
<div class="col-md-5 border-right">
<div class="p-3 py-5">
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="text-right">Profile Settings</h4>
</div>
<div class="row mt-2">
<div class="col-md-6">
<label class="labels">@Model.User.FirstName</label>
</div>
<div class="col-md-6">
<label class="labels"> @Model.User.LastName</label>
</div>
</div>
<div class="row mt-3">
<div class="col-md-12">
<label class="labels">@Model.BIO</label>
</div>
<div class="col-md-12">
<label class="labels">@Model.User.UserName</label>
</div>
<div class="col-md-12">
<label class="labels">Created at @Model.User.CreationTime</label>
</div>
<div class="col-md-12">
<label class="labels">has a @Model.MedicalStates.Count() medical cases</label>
</div>
</div>
<div class="mt-5 text-center"><a asp-action="Index" asp-controller="Home" class="btn btn-primary profile-button" type="button">Go Home</a></div>
</div>
</div>
<div class="col-md-4">
<div class="p-3 py-5">
<div class="d-flex justify-content-between align-items-center experience">
<span>
</span>
</div><br>
</div>
</div>
</div>
</div>
</section>
\ No newline at end of file
......@@ -4,6 +4,7 @@
ViewData["Title"] = "Patient ";
ViewData["Controller"] = "Patients";
Layout = "_AdminLayout";
}
<section class="page-section">
......@@ -54,7 +55,8 @@
<p class="text-muted">@item.User.CreationTime</p>
</div>
<div class="col-6 mb-3">
<button class="btn btn-danger btn-delete" data-id="@item.Id">Delete</button>
<button class="col btn btn-danger btn-delete m-1" data-id="@item.Id">Delete</button>
<a asp-controller="Patients" asp-action="Details" asp-route-id="@item.Id" class="m-1 col btn btn-info " data-id="@item.Id">Details</a>
</div>
......
......@@ -73,7 +73,7 @@
<!-- Patient Managment -->
<a class="nav-link collapsed"
asp-action="Inedx" asp-controller="Patient"
asp-action="Inedx" asp-controller="Patients"
data-bs-toggle="collapse" data-bs-target="#collapseLayouts" aria-expanded="false" aria-controls="collapseLayouts">
<div class="sb-nav-link-icon"><i class="fas fa-columns"></i></div>
Patients Managment
......@@ -81,8 +81,8 @@
</a>
<div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
<nav class="sb-sidenav-menu-nested nav">
<a class="nav-link" asp-controller="Patient" asp-action="Create">Add Patient </a>
<a class="nav-link" asp-controller="Patient" asp-action="Index">ALL Patients </a>
<a class="nav-link" asp-controller="Patients" asp-action="Create">Add Patient </a>
<a class="nav-link" asp-controller="Patients" asp-action="Index">ALL Patients </a>
</nav>
</div>
......
8fcaaae3247433165a2658c13700d6de9f58257b
24eb64f147b78c171c373da5f04e73db3fd3c533
......@@ -174,7 +174,6 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared\_AdminLayout.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared\_Layout.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared\_LoginPartial.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared\_PatrtialNotFound.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared\_ValidationScriptsPartial.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\_ViewImports.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\_ViewStart.cshtml.g.cs
......@@ -187,3 +186,6 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\ref\WebPresentatio
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.pdb
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.genruntimeconfig.cache
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Patients\Index.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Patients\Details.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared\PatrtialNotFound.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Patients\Delete.cshtml.g.cs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment