Commit cfaeb045 authored by hasan khaddour's avatar hasan khaddour

adding filters

parent b0a6dd21
......@@ -7,6 +7,8 @@ using AutoMapper;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Linq;
using System.Linq.Expressions;
namespace ApplicationCore.Services
{
......@@ -70,16 +72,11 @@ namespace ApplicationCore.Services
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);
_specification.Criteria = ol;
return _mapper.Map<IEnumerable<TDto>>(result);
return (_mapper.Map<IEnumerable<TDto>>(result)).Where(Cretira);
}
public Func<EntityBase, bool> MapFunc(Func<TDto, bool> dtoFunc)
{
......
......@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using ApplicationCore.DTOs;
using AutoMapper;
using System.Collections.Generic;
using ApplicationDomain.Exceptions;
namespace ApplicationCore.Services
{
......@@ -24,11 +25,29 @@ namespace ApplicationCore.Services
public async Task AddToMedicine(MedicineIngredientDTO medicineIngredientDto) {
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);
medicine.MedicineIngredients.Add(
medicineIngredient
);
_unitOfWork.Entity.Update(medicine);
try
{
_unitOfWork.Entity.Update(medicine);
}
catch {
throw new DomainException("the ingredient not exist ");
}
_unitOfWork.Commit();
}
......@@ -36,10 +55,16 @@ namespace ApplicationCore.Services
public async Task RemoveFromMedicine(MedicineIngredientDTO medicineIngredientDto)
{
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);
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.Commit();
......
......@@ -9,14 +9,21 @@ using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using WebPresentation.Filters.ModelStateValidation;
namespace WebPresentation.Controllers
{
public class CRUDController<TDto,TVModel> : BaseController where TDto : DTOBase where TVModel : ViewModels.BaseViewModel
{
protected readonly IMapper _mapper;
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(
UserManager<User> userManager,
IService<TDto> service,
......@@ -28,10 +35,13 @@ namespace WebPresentation.Controllers
_service = service;
}
protected virtual Func<TDto,bool> GetCriteria() {
return dto => true ;
}
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);
return View(model);
......@@ -49,20 +59,26 @@ namespace WebPresentation.Controllers
return RedirectToAction(nameof(Details),new { Id= id});
}
public async virtual Task<IActionResult> Details(int? id)
{
if (id is null)
{
return PartialView("PartialNotFound");
return View("NotFound");
}
else
{
TDto DetailDto = await _service.GetDetails((int)id);
if (DetailDto is null)
return PartialView("PartialNotFound");
TVModel model = _mapper.Map<TVModel>(DetailDto);
return View(model);
return View("NotFound");
if (_criteria(DetailDto))
{
TVModel model = _mapper.Map<TVModel>(DetailDto);
return View(model);
}
return View("NotFound");
}
}
......@@ -71,7 +87,7 @@ namespace WebPresentation.Controllers
TDto DetailDto = await _service.GetDetails(id);
if (DetailDto == null)
if (DetailDto == null || !_criteria(DetailDto))
{
return PartialView("PartialNotFound");
}
......@@ -95,8 +111,9 @@ namespace WebPresentation.Controllers
}
try
{
TDto tModel = await _service.GetDetails((int)id);
if (tModel == null)
if (tModel == null || !_criteria(tModel))
{
return PartialView("PartialNotFound");
}
......@@ -112,6 +129,7 @@ namespace WebPresentation.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
[StateValidationFilter]
public IActionResult Edit(int id, TVModel viewModel)
{
if (id != viewModel.Id)
......@@ -135,9 +153,8 @@ namespace WebPresentation.Controllers
}
return RedirectToAction("Details",new { id=dto.Id});
}
TVModel model = _mapper.Map<TVModel>(dto);
return PartialView(model);
return View(viewModel);
}
public IActionResult Create()
......@@ -147,13 +164,18 @@ namespace WebPresentation.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
[StateValidationFilter]
public virtual IActionResult Create(TVModel viewModel, int id)
{
if (ModelState.IsValid)
{
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);
return RedirectToAction("Details", new { id = viewModel.Id });
......@@ -175,7 +197,7 @@ namespace WebPresentation.Controllers
else
{
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 = "Succed", result = model });
......
......@@ -14,7 +14,7 @@ using System.Threading.Tasks;
namespace WebPresentation.Controllers
{
[Authorize(Roles ="patient")]
public class HomeController : BaseController
{
private readonly IMapper _mapper;
......@@ -38,11 +38,13 @@ namespace WebPresentation.Controllers
return _mapper.Map<PatientViewModel>(patient);
}
[Authorize(Roles = "patient")]
public async Task<IActionResult> Index()
{
var t =await getCurrentPatient();
return View(t);
}
[Authorize(Roles = "patient")]
public async Task<IActionResult> Edit(int id)
{
var t = await getCurrentPatient();
......@@ -51,14 +53,18 @@ namespace WebPresentation.Controllers
}
return View(t);
}
[Authorize(Roles = "patient")]
public async Task<IActionResult> Details(int? id ) {
var t = await getCurrentPatient();
return View(t);
}
[AllowAnonymous]
public IActionResult NotFoundPage() {
return View("NotFound");
}
[Authorize(Roles = "patient")]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
......
......@@ -34,20 +34,8 @@ namespace WebPresentation.Controllers
_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]
[ValidateAntiForgeryToken]
public override IActionResult Create(MedicalStateViewModel medicalState, int id)
......@@ -64,8 +52,14 @@ namespace WebPresentation.Controllers
}
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
[HttpGet]
......@@ -77,37 +71,45 @@ namespace WebPresentation.Controllers
[HttpPost]
public IActionResult AddMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
public async Task<IActionResult> AddMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
{
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);
_medicineService.AddToMedicalState(medicalStateMedicineModel);
return Ok(new { message = "Succed", result = "add" });
return Ok(new { message = "The medicine Added Successfully", result = "add" });
}
catch(DomainException e )
{
return NotFound(new { message = e.Message, result = "faild" });
return Ok(new { message = e.Message, result = "faild" });
}
catch
{
return NotFound(new { message = "Error ", result = "faild" });
return Ok(new { message = "Some thing went wrong", result = "faild" });
}
}
[HttpPost]
public IActionResult RemoveMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
public async Task<IActionResult> RemoveMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
{
MedicalStateMedicineDTO medicalStateMedicineModel = _mapper.Map<MedicalStateMedicineDTO>(medicalStateMedicine);
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);
return Ok(new { message = "Succed", result = "removed" });
return Ok(new { message = "the medicine reomved Successfully", result = "removed" });
}
......@@ -115,13 +117,13 @@ namespace WebPresentation.Controllers
catch (DomainException e)
{
return NotFound(new { message = e.Message, result = "faild" });
return Ok(new { message = e.Message, result = "faild" });
}
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;
using System;
using Microsoft.AspNetCore.Http;
using ApplicationCore.Mappere;
using WebPresentation.Filters.ModelStateValidation;
namespace WebPresentation
{
......@@ -126,6 +127,7 @@ namespace WebPresentation
services.AddSession();
services.AddScoped<StateValidationFilter>();
services.AddControllersWithViews().AddNewtonsoftJson(options =>
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
);
......@@ -165,8 +167,11 @@ namespace WebPresentation
name: "default",
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
public PatientViewModel Patient { get; set; }
[Display(Name ="State Name")]
[Required]
[MinLength(5)]
public String StateName { get; set; }
[Display(Name = "State Name")]
[Required]
public String StateDescription { get; set; }
[Display(Name = "State Name")]
[Required]
public DateTime PrescriptionTime { get; set; }
public ICollection<MedicineViewModel> Medicines { get; set; }
......
......@@ -158,9 +158,9 @@
<td>Manage</td>
</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 => {
let row = document.createElement('tr');
......
@{
Layout = "";
}
<style>
import url('https://fonts.googleapis.com/css?family=Montserrat:400,600,700');
import url('https://fonts.googleapis.com/css?family=Catamaran:400,800');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>not_found</title>
<style>
.error-container {
text-align: center;
font-size: 106px;
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);
}
body {
height: 97vh;
width: 100vh;
}
.error-container > span.zero {
vertical-align: text-top;
width: 156px;
height: 156px;
border-radius: 999px;
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;
position: absolute;
border-radius: 999px;
width: 70px;
height: 70px;
left: 43px;
bottom: 43px;
background: #FDFAF5;
box-shadow: -2px 2px 2px 0px rgba(0, 0, 0, 0.1);
}
img {
height: 100%;
}
.screen-reader-text {
position: absolute;
top: -9999em;
left: -9999em;
}
a {
display: block;
position: relative;
bottom: 90px;
left: 430px;
background-color: rgb(227, 16, 16);
width: 240px;
padding-top: 18px;
padding-bottom: 18px;
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;
}
keyframes bgshadow {
0% {
box-shadow: inset -160px 160px 0px 5px rgba(0, 0, 0, 0.4);
}
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);
}
}
.light {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 50%;
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
background-color: rgb(152, 7, 7);
}
/* demo stuff */
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
background-color: #FDFAF5;
margin-bottom: 50px;
}
html, button, input, select, textarea {
font-family: 'Montserrat', Helvetica, sans-serif;
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
.full {
position: relative;
}
</style>
</head>
<body>
<img class="image" src="img/assets/not_found2.png" alt="">
<a asp-action="Index" asp-controller="Home">
<div class="light"></div>
<div class="full">Back to Home</div>
</a>
</body>
</html>
\ No newline at end of file
......@@ -3,6 +3,7 @@
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">OOPs </h5>
<hr />
<br />
<p>Not Found</p>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
......@@ -15,4 +16,3 @@
</div>
</div>
......@@ -27,7 +27,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Filters\" />
<Folder Include="Views\Patients\" />
</ItemGroup>
......
......@@ -8,5 +8,9 @@
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
<View_SelectedScaffolderID>RazorViewEmptyScaffolder</View_SelectedScaffolderID>
<View_SelectedScaffolderCategoryPath>root/Common/MVC/View</View_SelectedScaffolderCategoryPath>
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
</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/>
#pragma warning disable 1591
[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;
#line default
#line hidden
#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")]
public class Views_Medicine_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MedicineViewModel>
{
......@@ -103,7 +103,7 @@ using System;
<div class=""col-md-4 gradient-custom text-center text-black""
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>();
......@@ -304,7 +304,7 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
<div class=""row pt-1"">
<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");
}
);
......@@ -320,7 +320,7 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
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 ");
}
);
......@@ -448,9 +448,9 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
WriteLiteral(@"ge</td>
</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 => {
let row = document.createElement('tr');
......@@ -472,8 +472,8 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
</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>
`
......@@ -497,9 +497,9 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
<i class=""fas fa-times""></i>
</span>
</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>
<p class="" mb-5""> what is the ratio </p>
......@@ -516,8 +516,8 @@ WriteAttributeValue("", 3782, ing.IngredientId, 3782, 17, false);
</div>
</div> `;
// Show the modal
const medicineModal = new bootstrap.Modal(document.getElementById('item");
WriteLiteral("\'));\r\n medicineModal.show();\r\n\r\n\r\n }\r\n async function addIngredientT(med) {\r\n let id =");
const medicineModal = new bootstrap.M");
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
#line 233 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Details.cshtml"
Write(Model.Id);
......
24eb64f147b78c171c373da5f04e73db3fd3c533
ee5748e123c05b8e601c75f3773a2aa816b62a99
03b45912ef86aa94764dc009b8646adac6f50d4b
40babbaebe908ee8019123f902e7ae02ef0aa7c7
......@@ -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\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
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