Commit cfaeb045 authored by hasan khaddour's avatar hasan khaddour

adding filters

parent b0a6dd21
...@@ -7,6 +7,8 @@ using AutoMapper; ...@@ -7,6 +7,8 @@ using AutoMapper;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Linq;
using System.Linq.Expressions;
namespace ApplicationCore.Services namespace ApplicationCore.Services
{ {
...@@ -70,16 +72,11 @@ namespace ApplicationCore.Services ...@@ -70,16 +72,11 @@ namespace ApplicationCore.Services
public async Task<IEnumerable<TDto>> GetByCriteria(Func<TDto, bool> Cretira) public async Task<IEnumerable<TDto>> GetByCriteria(Func<TDto, bool> Cretira)
{ {
Func<TEntity, bool> t = MapFunc(Cretira);
var ol = _specification.Criteria;
_specification.Criteria = expr =>t.Invoke(expr);
var result =await _unitOfWork.Entity.GetAll(_specification); var result =await _unitOfWork.Entity.GetAll(_specification);
_specification.Criteria = ol;
return (_mapper.Map<IEnumerable<TDto>>(result)).Where(Cretira);
return _mapper.Map<IEnumerable<TDto>>(result);
} }
public Func<EntityBase, bool> MapFunc(Func<TDto, bool> dtoFunc) public Func<EntityBase, bool> MapFunc(Func<TDto, bool> dtoFunc)
{ {
......
...@@ -8,6 +8,7 @@ using System.Threading.Tasks; ...@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using ApplicationCore.DTOs; using ApplicationCore.DTOs;
using AutoMapper; using AutoMapper;
using System.Collections.Generic; using System.Collections.Generic;
using ApplicationDomain.Exceptions;
namespace ApplicationCore.Services namespace ApplicationCore.Services
{ {
...@@ -24,11 +25,29 @@ namespace ApplicationCore.Services ...@@ -24,11 +25,29 @@ namespace ApplicationCore.Services
public async Task AddToMedicine(MedicineIngredientDTO medicineIngredientDto) { public async Task AddToMedicine(MedicineIngredientDTO medicineIngredientDto) {
var medicine = await _unitOfWork.Entity.GetById(medicineIngredientDto.IngredientId,_specification); var medicine = await _unitOfWork.Entity.GetById(medicineIngredientDto.IngredientId,_specification);
if (medicine.MedicineIngredients is null)
medicine.MedicineIngredients = new List<MedicineIngredient>();
foreach (var i in medicine.MedicineIngredients)
{
if (
i.MedicineId ==medicineIngredientDto.MedicineId
&&
i.IngredientId == medicineIngredientDto.IngredientId
)
throw new DomainException("the ingredient already exist in the medicine ");
}
MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientDto); MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientDto);
medicine.MedicineIngredients.Add( medicine.MedicineIngredients.Add(
medicineIngredient medicineIngredient
); );
try
{
_unitOfWork.Entity.Update(medicine); _unitOfWork.Entity.Update(medicine);
}
catch {
throw new DomainException("the ingredient not exist ");
}
_unitOfWork.Commit(); _unitOfWork.Commit();
} }
...@@ -36,10 +55,16 @@ namespace ApplicationCore.Services ...@@ -36,10 +55,16 @@ namespace ApplicationCore.Services
public async Task RemoveFromMedicine(MedicineIngredientDTO medicineIngredientDto) public async Task RemoveFromMedicine(MedicineIngredientDTO medicineIngredientDto)
{ {
var ingredient = await _unitOfWork.Ingredients.GetById(medicineIngredientDto.IngredientId, _specification); var ingredient = await _unitOfWork.Ingredients.GetById(medicineIngredientDto.IngredientId, _specification);
if (ingredient.MedicineIngredients is null)
throw new DomainException("you dont have this ingredient");
MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientDto); MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientDto);
var m =ingredient.MedicineIngredients.Where(p => p.MedicineId == medicineIngredientDto.MedicineId).FirstOrDefault(); var m =ingredient.MedicineIngredients.Where(p => p.MedicineId == medicineIngredientDto.MedicineId).FirstOrDefault();
ingredient.MedicineIngredients.Remove(m); if(m is null )
throw new DomainException("the medicine doesn't exist ");
if (!ingredient.MedicineIngredients.Remove(m))
throw new DomainException("you dont have this ingredient");
_unitOfWork.Entity.Update(ingredient); _unitOfWork.Entity.Update(ingredient);
_unitOfWork.Commit(); _unitOfWork.Commit();
......
...@@ -9,14 +9,21 @@ using System; ...@@ -9,14 +9,21 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using WebPresentation.Filters.ModelStateValidation;
namespace WebPresentation.Controllers namespace WebPresentation.Controllers
{ {
public class CRUDController<TDto,TVModel> : BaseController where TDto : DTOBase where TVModel : ViewModels.BaseViewModel public class CRUDController<TDto,TVModel> : BaseController where TDto : DTOBase where TVModel : ViewModels.BaseViewModel
{ {
protected readonly IMapper _mapper; protected readonly IMapper _mapper;
protected readonly IService<TDto> _service; protected readonly IService<TDto> _service;
protected Func<TDto, bool> Criteria; private Func<TDto, bool> _criteriaProtected;
protected Func<TDto, bool> _criteria {
get {
if (_criteriaProtected == null) {
_criteriaProtected = GetCriteria();
}
return _criteriaProtected;
} set { _criteriaProtected = value; } }
public CRUDController( public CRUDController(
UserManager<User> userManager, UserManager<User> userManager,
IService<TDto> service, IService<TDto> service,
...@@ -28,10 +35,13 @@ namespace WebPresentation.Controllers ...@@ -28,10 +35,13 @@ namespace WebPresentation.Controllers
_service = service; _service = service;
} }
protected virtual Func<TDto,bool> GetCriteria() {
return dto => true ;
}
public async virtual Task<IActionResult> Index() public async virtual Task<IActionResult> Index()
{ {
var DetailDto = await _service.GetAll(); var DetailDto = await _service.GetByCriteria(GetCriteria());
IEnumerable<TVModel> model = _mapper.Map<IEnumerable<TVModel>>(DetailDto); IEnumerable<TVModel> model = _mapper.Map<IEnumerable<TVModel>>(DetailDto);
return View(model); return View(model);
...@@ -49,21 +59,27 @@ namespace WebPresentation.Controllers ...@@ -49,21 +59,27 @@ namespace WebPresentation.Controllers
return RedirectToAction(nameof(Details),new { Id= id}); return RedirectToAction(nameof(Details),new { Id= id});
} }
public async virtual Task<IActionResult> Details(int? id) public async virtual Task<IActionResult> Details(int? id)
{ {
if (id is null) if (id is null)
{ {
return PartialView("PartialNotFound"); return View("NotFound");
} }
else else
{ {
TDto DetailDto = await _service.GetDetails((int)id); TDto DetailDto = await _service.GetDetails((int)id);
if (DetailDto is null) if (DetailDto is null)
return PartialView("PartialNotFound"); return View("NotFound");
if (_criteria(DetailDto))
{
TVModel model = _mapper.Map<TVModel>(DetailDto); TVModel model = _mapper.Map<TVModel>(DetailDto);
return View(model); return View(model);
} }
return View("NotFound");
}
} }
public async Task< IActionResult> Delete(int id) public async Task< IActionResult> Delete(int id)
...@@ -71,7 +87,7 @@ namespace WebPresentation.Controllers ...@@ -71,7 +87,7 @@ namespace WebPresentation.Controllers
TDto DetailDto = await _service.GetDetails(id); TDto DetailDto = await _service.GetDetails(id);
if (DetailDto == null) if (DetailDto == null || !_criteria(DetailDto))
{ {
return PartialView("PartialNotFound"); return PartialView("PartialNotFound");
} }
...@@ -95,8 +111,9 @@ namespace WebPresentation.Controllers ...@@ -95,8 +111,9 @@ namespace WebPresentation.Controllers
} }
try try
{ {
TDto tModel = await _service.GetDetails((int)id); TDto tModel = await _service.GetDetails((int)id);
if (tModel == null) if (tModel == null || !_criteria(tModel))
{ {
return PartialView("PartialNotFound"); return PartialView("PartialNotFound");
} }
...@@ -112,6 +129,7 @@ namespace WebPresentation.Controllers ...@@ -112,6 +129,7 @@ namespace WebPresentation.Controllers
[HttpPost] [HttpPost]
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
[StateValidationFilter]
public IActionResult Edit(int id, TVModel viewModel) public IActionResult Edit(int id, TVModel viewModel)
{ {
if (id != viewModel.Id) if (id != viewModel.Id)
...@@ -135,9 +153,8 @@ namespace WebPresentation.Controllers ...@@ -135,9 +153,8 @@ namespace WebPresentation.Controllers
} }
return RedirectToAction("Details",new { id=dto.Id}); return RedirectToAction("Details",new { id=dto.Id});
} }
TVModel model = _mapper.Map<TVModel>(dto);
return PartialView(model); return View(viewModel);
} }
public IActionResult Create() public IActionResult Create()
...@@ -147,13 +164,18 @@ namespace WebPresentation.Controllers ...@@ -147,13 +164,18 @@ namespace WebPresentation.Controllers
[HttpPost] [HttpPost]
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
[StateValidationFilter]
public virtual IActionResult Create(TVModel viewModel, int id) public virtual IActionResult Create(TVModel viewModel, int id)
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
TDto dto = _mapper.Map<TDto>(viewModel); TDto dto = _mapper.Map<TDto>(viewModel);
dto= _service.Create(dto); if (viewModel == null || !_criteria(dto))
{
return View(viewModel);
}
dto = _service.Create(dto);
viewModel = _mapper.Map<TVModel>(dto); viewModel = _mapper.Map<TVModel>(dto);
return RedirectToAction("Details", new { id = viewModel.Id }); return RedirectToAction("Details", new { id = viewModel.Id });
...@@ -175,7 +197,7 @@ namespace WebPresentation.Controllers ...@@ -175,7 +197,7 @@ namespace WebPresentation.Controllers
else else
{ {
TDto model = await _service.GetDetails((int)id); TDto model = await _service.GetDetails((int)id);
if (model is null) if (model is null || !_criteria(model))
return Ok(new { message = "No Data Found ", result = "Faild" }); return Ok(new { message = "No Data Found ", result = "Faild" });
return Ok(new { message = "Succed", result = model }); return Ok(new { message = "Succed", result = model });
......
...@@ -14,7 +14,7 @@ using System.Threading.Tasks; ...@@ -14,7 +14,7 @@ using System.Threading.Tasks;
namespace WebPresentation.Controllers namespace WebPresentation.Controllers
{ {
[Authorize(Roles ="patient")]
public class HomeController : BaseController public class HomeController : BaseController
{ {
private readonly IMapper _mapper; private readonly IMapper _mapper;
...@@ -38,11 +38,13 @@ namespace WebPresentation.Controllers ...@@ -38,11 +38,13 @@ namespace WebPresentation.Controllers
return _mapper.Map<PatientViewModel>(patient); return _mapper.Map<PatientViewModel>(patient);
} }
[Authorize(Roles = "patient")]
public async Task<IActionResult> Index() public async Task<IActionResult> Index()
{ {
var t =await getCurrentPatient(); var t =await getCurrentPatient();
return View(t); return View(t);
} }
[Authorize(Roles = "patient")]
public async Task<IActionResult> Edit(int id) public async Task<IActionResult> Edit(int id)
{ {
var t = await getCurrentPatient(); var t = await getCurrentPatient();
...@@ -51,14 +53,18 @@ namespace WebPresentation.Controllers ...@@ -51,14 +53,18 @@ namespace WebPresentation.Controllers
} }
return View(t); return View(t);
} }
[Authorize(Roles = "patient")]
public async Task<IActionResult> Details(int? id ) { public async Task<IActionResult> Details(int? id ) {
var t = await getCurrentPatient(); var t = await getCurrentPatient();
return View(t); return View(t);
} }
[AllowAnonymous]
public IActionResult NotFoundPage() {
return View("NotFound");
}
[Authorize(Roles = "patient")]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error() public IActionResult Error()
{ {
......
...@@ -34,18 +34,6 @@ namespace WebPresentation.Controllers ...@@ -34,18 +34,6 @@ namespace WebPresentation.Controllers
_medicineService = medicineService; _medicineService = medicineService;
} }
public async override Task<IActionResult> Index( )
{
var u = GetUserId();
var p = await _patientService.GetByUserId(u);
var pId= p.Id;
var meds =await ((IMedicalStateService )_service).GetAllPatientMedicalStates(pId);
return View(_mapper.Map<IEnumerable<MedicalStateViewModel>>(meds));
}
[HttpPost] [HttpPost]
...@@ -64,7 +52,13 @@ namespace WebPresentation.Controllers ...@@ -64,7 +52,13 @@ namespace WebPresentation.Controllers
} }
return View(medicalState); return View(medicalState);
} }
protected override Func<MedicalStateDTO, bool> GetCriteria()
{
var u = _patientService.GetByUserId(GetUserId()).Result.Id;
_criteria = p => p.PatientId == u;
return _criteria;
}
#region json #region json
...@@ -77,37 +71,45 @@ namespace WebPresentation.Controllers ...@@ -77,37 +71,45 @@ namespace WebPresentation.Controllers
[HttpPost] [HttpPost]
public IActionResult AddMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine) public async Task<IActionResult> AddMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
{ {
try try
{ {
var medical = await _medicalStateService.GetDetails(medicalStateMedicine.MedicalStateId);
if(!_criteria(medical))
return Ok(new { message = "You try to add a medicine for other patient and this is wrong , you shouldn't add a medicine for others", result = "faild" });
var medicalStateMedicineModel = _mapper.Map<MedicalStateMedicineDTO>(medicalStateMedicine); var medicalStateMedicineModel = _mapper.Map<MedicalStateMedicineDTO>(medicalStateMedicine);
_medicineService.AddToMedicalState(medicalStateMedicineModel); _medicineService.AddToMedicalState(medicalStateMedicineModel);
return Ok(new { message = "Succed", result = "add" }); return Ok(new { message = "The medicine Added Successfully", result = "add" });
} }
catch(DomainException e ) catch(DomainException e )
{ {
return NotFound(new { message = e.Message, result = "faild" }); return Ok(new { message = e.Message, result = "faild" });
} }
catch catch
{ {
return NotFound(new { message = "Error ", result = "faild" }); return Ok(new { message = "Some thing went wrong", result = "faild" });
} }
} }
[HttpPost] [HttpPost]
public IActionResult RemoveMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine) public async Task<IActionResult> RemoveMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
{ {
MedicalStateMedicineDTO medicalStateMedicineModel = _mapper.Map<MedicalStateMedicineDTO>(medicalStateMedicine); MedicalStateMedicineDTO medicalStateMedicineModel = _mapper.Map<MedicalStateMedicineDTO>(medicalStateMedicine);
try try
{ {
var medical = await _medicalStateService.GetDetails(medicalStateMedicine.MedicineId);
if (!_criteria(medical))
return Ok(new { message = "You try to Reomve a medicine for other patient and this is wrong , you shouldn't remove a medicine for others maybe this kill him", result = "faild" });
_medicineService.RemoveFromMedicalState(medicalStateMedicineModel); _medicineService.RemoveFromMedicalState(medicalStateMedicineModel);
return Ok(new { message = "Succed", result = "removed" }); return Ok(new { message = "the medicine reomved Successfully", result = "removed" });
} }
...@@ -115,13 +117,13 @@ namespace WebPresentation.Controllers ...@@ -115,13 +117,13 @@ namespace WebPresentation.Controllers
catch (DomainException e) catch (DomainException e)
{ {
return NotFound(new { message = e.Message, result = "faild" }); return Ok(new { message = e.Message, result = "faild" });
} }
catch catch
{ {
return NotFound(new { message = "Error ", result = "faild" }); return Ok(new { message = "something went wrong", result = "faild" });
} }
} }
......
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebPresentation.ViewModels;
namespace WebPresentation.Filters.ModelStateValidation
{
public class StateValidationFilter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext context)
{
if (!context.ModelState.IsValid)
{
Controller controller = context.Controller as Controller;
if (controller != null)
{
var model = context.ActionArguments.Values.Where(p=> p is not int ).FirstOrDefault();
var actionName = context.ActionDescriptor.RouteValues["action"];
context.Result = controller.View(actionName, model);
return;
}
else
{
context.Result = new BadRequestObjectResult(context.ModelState);
}
}
}
}
}
...@@ -20,6 +20,7 @@ using ApplicationCore.Mapper; ...@@ -20,6 +20,7 @@ using ApplicationCore.Mapper;
using System; using System;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using ApplicationCore.Mappere; using ApplicationCore.Mappere;
using WebPresentation.Filters.ModelStateValidation;
namespace WebPresentation namespace WebPresentation
{ {
...@@ -126,6 +127,7 @@ namespace WebPresentation ...@@ -126,6 +127,7 @@ namespace WebPresentation
services.AddSession(); services.AddSession();
services.AddScoped<StateValidationFilter>();
services.AddControllersWithViews().AddNewtonsoftJson(options => services.AddControllersWithViews().AddNewtonsoftJson(options =>
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
); );
...@@ -165,7 +167,10 @@ namespace WebPresentation ...@@ -165,7 +167,10 @@ namespace WebPresentation
name: "default", name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}"); pattern: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapControllerRoute(
name: "notFound",
pattern: "{*url}",
defaults: new { controller = "Home", action = "NotFoundPage" });
}); });
} }
} }
......
...@@ -13,8 +13,15 @@ namespace WebPresentation.ViewModels ...@@ -13,8 +13,15 @@ namespace WebPresentation.ViewModels
public PatientViewModel Patient { get; set; } public PatientViewModel Patient { get; set; }
[Display(Name ="State Name")] [Display(Name ="State Name")]
[Required]
[MinLength(5)]
public String StateName { get; set; } public String StateName { get; set; }
[Display(Name = "State Name")]
[Required]
public String StateDescription { get; set; } public String StateDescription { get; set; }
[Display(Name = "State Name")]
[Required]
public DateTime PrescriptionTime { get; set; } public DateTime PrescriptionTime { get; set; }
public ICollection<MedicineViewModel> Medicines { get; set; } public ICollection<MedicineViewModel> Medicines { get; set; }
......
...@@ -158,9 +158,9 @@ ...@@ -158,9 +158,9 @@
<td>Manage</td> <td>Manage</td>
</tr> </tr>
</thead ><tbody id="b"> </tbody></table>`; </thead ><tbody id="${tableName + "b"}" > </tbody></table>`;
tableBody = document.querySelector('#b'); tableBody = document.querySelector("#" + tableName + "b");
medicines.forEach(medicine => { medicines.forEach(medicine => {
let row = document.createElement('tr'); let row = document.createElement('tr');
......
@{ @{
Layout = ""; Layout = "";
} }
<style> <!DOCTYPE html>
import url('https://fonts.googleapis.com/css?family=Montserrat:400,600,700'); <html lang="en">
import url('https://fonts.googleapis.com/css?family=Catamaran:400,800'); <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>not_found</title>
<style>
.error-container { body {
text-align: center; height: 97vh;
font-size: 106px; width: 100vh;
font-family: 'Catamaran', sans-serif;
font-weight: 800;
margin: 70px 15px;
} }
.error-container > span {
display: inline-block;
position: relative;
}
.error-container > span.four {
width: 136px;
height: 43px;
border-radius: 999px;
background:
linear-gradient(140deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.07) 43%, transparent 44%, transparent 100%),
linear-gradient(105deg, transparent 0%, transparent 40%, rgba(0, 0, 0, 0.06) 41%, rgba(0, 0, 0, 0.07) 76%, transparent 77%, transparent 100%),
linear-gradient(to right, #d89ca4, #e27b7e);
}
.error-container > span.four:before,
.error-container > span.four:after {
content: '';
display: block;
position: absolute;
border-radius: 999px;
}
.error-container > span.four:before {
width: 43px;
height: 156px;
left: 60px;
bottom: -43px;
background:
linear-gradient(128deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.07) 40%, transparent 41%, transparent 100%),
linear-gradient(116deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.07) 50%, transparent 51%, transparent 100%),
linear-gradient(to top, #99749D, #B895AB, #CC9AA6, #D7969E, #E0787F);
}
.error-container > span.four:after {
width: 137px;
height: 43px;
transform: rotate(-49.5deg);
left: -18px;
bottom: 36px;
background: linear-gradient(to right, #99749D, #B895AB, #CC9AA6, #D7969E, #E0787F);
}
.error-container > span.zero { img {
vertical-align: text-top; height: 100%;
width: 156px; }
height: 156px;
border-radius: 999px; a {
background: linear-gradient(-45deg, transparent 0%, rgba(0, 0, 0, 0.06) 50%, transparent 51%, transparent 100%),
linear-gradient(to top right, #99749D, #99749D, #B895AB, #CC9AA6, #D7969E, #ED8687, #ED8687);
overflow: hidden;
animation: bgshadow 5s infinite;
}
.error-container > span.zero:before {
content: '';
display: block;
position: absolute;
transform: rotate(45deg);
width: 90px;
height: 90px;
background-color: transparent;
left: 0px;
bottom: 0px;
background:
linear-gradient(95deg, transparent 0%, transparent 8%, rgba(0, 0, 0, 0.07) 9%, transparent 50%, transparent 100%),
linear-gradient(85deg, transparent 0%, transparent 19%, rgba(0, 0, 0, 0.05) 20%, rgba(0, 0, 0, 0.07) 91%, transparent 92%, transparent 100%);
}
.error-container > span.zero:after {
content: '';
display: block; display: block;
position: absolute; position: relative;
border-radius: 999px; bottom: 90px;
width: 70px; left: 430px;
height: 70px; background-color: rgb(227, 16, 16);
left: 43px; width: 240px;
bottom: 43px; padding-top: 18px;
background: #FDFAF5; padding-bottom: 18px;
box-shadow: -2px 2px 2px 0px rgba(0, 0, 0, 0.1); text-decoration: none;
} border-radius: 60px;
font-size: xx-large;
text-align: center;
color: white;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
border: 6px solid black;
z-index: 1;
}
.screen-reader-text { .light {
position: absolute; position: absolute;
top: -9999em; left: 0;
left: -9999em; bottom: 0;
} width: 100%;
height: 50%;
keyframes bgshadow { border-bottom-left-radius: inherit;
0% { border-bottom-right-radius: inherit;
box-shadow: inset -160px 160px 0px 5px rgba(0, 0, 0, 0.4); background-color: rgb(152, 7, 7);
}
45% {
box-shadow: inset 0px 0px 0px 0px rgba(0, 0, 0, 0.1);
}
55% {
box-shadow: inset 0px 0px 0px 0px rgba(0, 0, 0, 0.1);
} }
100% {
box-shadow: inset 160px -160px 0px 5px rgba(0, 0, 0, 0.4); .full {
position: relative;
} }
}
/* demo stuff */ </style>
* { </head>
-webkit-box-sizing: border-box; <body>
-moz-box-sizing: border-box; <img class="image" src="img/assets/not_found2.png" alt="">
box-sizing: border-box; <a asp-action="Index" asp-controller="Home">
} <div class="light"></div>
body { <div class="full">Back to Home</div>
background-color: #FDFAF5; </a>
margin-bottom: 50px;
} </body>
html, button, input, select, textarea { </html>
font-family: 'Montserrat', Helvetica, sans-serif; \ No newline at end of file
color: #bbb;
}
h1 {
text-align: center;
margin: 30px 15px;
}
.zoom-area {
max-width: 490px;
margin: 30px auto 30px;
font-size: 19px;
text-align: center;
}
.link-container {
text-align: center;
}
a.more-link {
text-transform: uppercase;
font-size: 13px;
background-color: #de7e85;
padding: 10px 15px;
border-radius: 0;
color: #fff;
display: inline-block;
margin-right: 5px;
margin-bottom: 5px;
line-height: 1.5;
text-decoration: none;
margin-top: 50px;
letter-spacing: 1px;
}
</style>
<section class="page-section">
<h1>404 Error Page #2</h1>
<p class="zoom-area"><b>CSS</b> animations to make a cool 404 page. </p>
<section class="error-container">
<span class="four"><span class="screen-reader-text">4</span></span>
<span class="zero"><span class="screen-reader-text">0</span></span>
<span class="four"><span class="screen-reader-text">4</span></span>
</section>
<div class="link-container">
<a target="_blank" href="https://www.silocreativo.com/en/creative-examples-404-error-css/" class="more-link">Visit the original article</a>
</div>
</section>
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">OOPs </h5> <h5 class="modal-title" id="modalEditLabel">OOPs </h5>
<hr /> <hr />
<br />
<p>Not Found</p> <p>Not Found</p>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
...@@ -15,4 +16,3 @@ ...@@ -15,4 +16,3 @@
</div> </div>
</div>
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Filters\" />
<Folder Include="Views\Patients\" /> <Folder Include="Views\Patients\" />
</ItemGroup> </ItemGroup>
......
...@@ -8,5 +8,9 @@ ...@@ -8,5 +8,9 @@
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
<View_SelectedScaffolderID>RazorViewEmptyScaffolder</View_SelectedScaffolderID> <View_SelectedScaffolderID>RazorViewEmptyScaffolder</View_SelectedScaffolderID>
<View_SelectedScaffolderCategoryPath>root/Common/MVC/View</View_SelectedScaffolderCategoryPath> <View_SelectedScaffolderCategoryPath>root/Common/MVC/View</View_SelectedScaffolderCategoryPath>
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
\ No newline at end of file
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3adb1006546d7a2aac9737521701c9562d1419eb" #pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "5e75b0dcb377daeda9a27984f637bf1b5b1d6ba1"
// <auto-generated/> // <auto-generated/>
#pragma warning disable 1591 #pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_Details), @"mvc.1.0.view", @"/Views/Medicine/Details.cshtml")] [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_Details), @"mvc.1.0.view", @"/Views/Medicine/Details.cshtml")]
...@@ -46,7 +46,7 @@ using System; ...@@ -46,7 +46,7 @@ using System;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"3adb1006546d7a2aac9737521701c9562d1419eb", @"/Views/Medicine/Details.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"5e75b0dcb377daeda9a27984f637bf1b5b1d6ba1", @"/Views/Medicine/Details.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a2f5fee0d7223f937b9f0309fc3b9062263e26d", @"/Views/_ViewImports.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a2f5fee0d7223f937b9f0309fc3b9062263e26d", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MedicineViewModel> public class Views_Medicine_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MedicineViewModel>
{ {
...@@ -103,7 +103,7 @@ using System; ...@@ -103,7 +103,7 @@ using System;
<div class=""col-md-4 gradient-custom text-center text-black"" <div class=""col-md-4 gradient-custom text-center text-black""
style=""border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;""> style=""border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;"">
"); ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "3adb1006546d7a2aac9737521701c9562d1419eb6604", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "5e75b0dcb377daeda9a27984f637bf1b5b1d6ba16604", async() => {
} }
); );
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>(); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
...@@ -304,7 +304,7 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false); ...@@ -304,7 +304,7 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
<div class=""row pt-1""> <div class=""row pt-1"">
<div class=""col-6 mb-3""> <div class=""col-6 mb-3"">
"); ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3adb1006546d7a2aac9737521701c9562d1419eb16637", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "5e75b0dcb377daeda9a27984f637bf1b5b1d6ba116637", async() => {
WriteLiteral("Back to List"); WriteLiteral("Back to List");
} }
); );
...@@ -320,7 +320,7 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false); ...@@ -320,7 +320,7 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
Write(__tagHelperExecutionContext.Output); Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End(); __tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n\r\n </div>\r\n <div class=\"col-6 mb-3\">\r\n "); WriteLiteral("\r\n\r\n </div>\r\n <div class=\"col-6 mb-3\">\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3adb1006546d7a2aac9737521701c9562d1419eb17955", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "5e75b0dcb377daeda9a27984f637bf1b5b1d6ba117955", async() => {
WriteLiteral("Add Ingredients "); WriteLiteral("Add Ingredients ");
} }
); );
...@@ -448,9 +448,9 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false); ...@@ -448,9 +448,9 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
WriteLiteral(@"ge</td> WriteLiteral(@"ge</td>
</tr> </tr>
</thead ><tbody id=""b""> </tbody></table>`; </thead ><tbody id=""${tableName + ""b""}"" > </tbody></table>`;
tableBody = document.querySelector('#b'); tableBody = document.querySelector(""#"" + tableName + ""b"");
medicines.forEach(medicine => { medicines.forEach(medicine => {
let row = document.createElement('tr'); let row = document.createElement('tr');
...@@ -472,8 +472,8 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false); ...@@ -472,8 +472,8 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
</td> </td>
` : ` :
`<td> `<td>
<button class=""btn btn-primary"""); ");
WriteLiteral(@" onclick=""addIngredient( ${medicine.id})"" data-dismiss=""modal"" aria-label=""Close"">Add</button> WriteLiteral(@" <button class=""btn btn-primary"" onclick=""addIngredient( ${medicine.id})"" data-dismiss=""modal"" aria-label=""Close"">Add</button>
</td> </td>
` `
...@@ -497,9 +497,9 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false); ...@@ -497,9 +497,9 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
<i class=""fas fa-times""></i> <i class=""fas fa-times""></i>
</span> </span>
</button> </button>
</div>
"); ");
WriteLiteral(@" <div class=""modal-body text-start p-3""> WriteLiteral(@" </div>
<div class=""modal-body text-start p-3"">
<h5 class=""modal-title text-uppercase mb-5"" id=""exampleModalLabel"">chose the ratio</h5> <h5 class=""modal-title text-uppercase mb-5"" id=""exampleModalLabel"">chose the ratio</h5>
<p class="" mb-5""> what is the ratio </p> <p class="" mb-5""> what is the ratio </p>
...@@ -516,8 +516,8 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false); ...@@ -516,8 +516,8 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
</div> </div>
</div> `; </div> `;
// Show the modal // Show the modal
const medicineModal = new bootstrap.Modal(document.getElementById('item"); const medicineModal = new bootstrap.M");
WriteLiteral("\'));\r\n medicineModal.show();\r\n\r\n\r\n }\r\n async function addIngredientT(med) {\r\n let id ="); WriteLiteral("odal(document.getElementById(\'item\'));\r\n medicineModal.show();\r\n\r\n\r\n }\r\n async function addIngredientT(med) {\r\n let id =");
#nullable restore #nullable restore
#line 233 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Details.cshtml" #line 233 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Details.cshtml"
Write(Model.Id); Write(Model.Id);
......
24eb64f147b78c171c373da5f04e73db3fd3c533 ee5748e123c05b8e601c75f3773a2aa816b62a99
03b45912ef86aa94764dc009b8646adac6f50d4b 40babbaebe908ee8019123f902e7ae02ef0aa7c7
...@@ -187,5 +187,5 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.pd ...@@ -187,5 +187,5 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.pd
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.genruntimeconfig.cache 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\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\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 C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Patients\Delete.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared\PartialNotFound.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