Commit 55d01699 authored by hasan khaddour's avatar hasan khaddour

add partial views

parent 0aec6304
...@@ -22,6 +22,18 @@ namespace WebPresentation.Controllers ...@@ -22,6 +22,18 @@ namespace WebPresentation.Controllers
_service = service; _service = service;
} }
public IActionResult Dummy(int id)
{
return PartialView(id);
}
// Post method to edit a medicine
[HttpPost]
public IActionResult Dummy(int id, string s)
{
return RedirectToAction(nameof(Details),new { Id= id});
}
public async virtual Task<IActionResult> Details(int? id) public async virtual Task<IActionResult> Details(int? id)
{ {
...@@ -49,7 +61,7 @@ namespace WebPresentation.Controllers ...@@ -49,7 +61,7 @@ namespace WebPresentation.Controllers
return View("NotFound"); return View("NotFound");
} }
return View(TModel); return PartialView(TModel);
} }
public async virtual Task<IActionResult> Index() public async virtual Task<IActionResult> Index()
...@@ -80,7 +92,7 @@ namespace WebPresentation.Controllers ...@@ -80,7 +92,7 @@ namespace WebPresentation.Controllers
{ {
return View("NotFound"); return View("NotFound");
} }
return View(tModel); return PartialView(tModel);
} }
[HttpPost] [HttpPost]
...@@ -107,7 +119,7 @@ namespace WebPresentation.Controllers ...@@ -107,7 +119,7 @@ namespace WebPresentation.Controllers
} }
return RedirectToAction("Details",new { id=tModel.Id}); return RedirectToAction("Details",new { id=tModel.Id});
} }
return View(tModel); return PartialView(tModel);
} }
public IActionResult Create() public IActionResult Create()
......
...@@ -26,5 +26,7 @@ namespace WebPresentation.Controllers ...@@ -26,5 +26,7 @@ namespace WebPresentation.Controllers
return Ok(s); return Ok(s);
} }
} }
} }
...@@ -51,12 +51,7 @@ namespace WebPresentation.Controllers ...@@ -51,12 +51,7 @@ namespace WebPresentation.Controllers
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
var uId = GetUserId(); var uId = GetUserId();
var p = _patientService.GetAll( var p = _patientService.GetByUserId(uId).Id;
).Result
.Where(
u => u.User.Id == uId
)
.FirstOrDefault().Id;
if (medicalState.PrescriptionTime == DateTime.MinValue ) if (medicalState.PrescriptionTime == DateTime.MinValue )
medicalState.PrescriptionTime = DateTime.Now; medicalState.PrescriptionTime = DateTime.Now;
var n= ((IMedicalStateService)_service).AddToPateint(p,medicalState); var n= ((IMedicalStateService)_service).AddToPateint(p,medicalState);
...@@ -150,7 +145,6 @@ namespace WebPresentation.Controllers ...@@ -150,7 +145,6 @@ namespace WebPresentation.Controllers
public JsonResult GetMedicines() public JsonResult GetMedicines()
{ {
var all = _medicineService.GetAll().Result; var all = _medicineService.GetAll().Result;
return new JsonResult(all); return new JsonResult(all);
} }
......
...@@ -13,19 +13,14 @@ namespace WebPresentation.Controllers ...@@ -13,19 +13,14 @@ namespace WebPresentation.Controllers
public class MedicineController : CRUDController<MedicineModel> public class MedicineController : CRUDController<MedicineModel>
{ {
private readonly IIngredientService _ingredientService; private readonly IIngredientService _ingredientService;
private readonly IMedicineService _medicineService;
private readonly IPatientService _patientService;
public MedicineController(UserManager<User> userManager, public MedicineController(UserManager<User> userManager,
IMedicineService medicineService , IMedicineService medicineService ,
IIngredientService ingredientService , IIngredientService ingredientService
IPatientService patientService
):base(userManager ,medicineService) ):base(userManager ,medicineService)
{ {
_ingredientService =ingredientService; _ingredientService =ingredientService;
_medicineService = medicineService;
_patientService =patientService;
} }
...@@ -34,9 +29,9 @@ namespace WebPresentation.Controllers ...@@ -34,9 +29,9 @@ namespace WebPresentation.Controllers
[Authorize(Roles = "Admin")] [Authorize(Roles = "Admin")]
[HttpPost] [HttpPost]
public IActionResult ReomveIngredient([FromBody] MedicineIngredientModel medicineIngredientModel) public async Task<IActionResult> ReomveIngredient([FromBody] MedicineIngredientModel medicineIngredientModel)
{ {
_ingredientService.RemoveFromMedicine(medicineIngredientModel); await _ingredientService.RemoveFromMedicine(medicineIngredientModel);
return Ok(new {message = "removed" }); return Ok(new {message = "removed" });
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName; ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName;
ViewBag.Avatar = Model.User.Avatar; ViewBag.Avatar = Model.User.Avatar;
ViewData["Controller"] = "Home";
ViewBag.owner = Model; ViewBag.owner = Model;
var DummyModel = new MedicalState { StateName="state name" , StateDescription="Description" , PrescriptionTime=DateTime.Now}; var DummyModel = new MedicalState { StateName="state name" , StateDescription="Description" , PrescriptionTime=DateTime.Now};
...@@ -55,7 +56,7 @@ ...@@ -55,7 +56,7 @@
<div class="row"> <div class="row">
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mb-5"> <div class="col-lg-4 col-md-6 d-flex flex-column align-items-stretch mb-5">
<div class="icon-box"> <div class="icon-box">
<div class="icon"><i class="fas fa-heartbeat"></i></div> <div class="icon"><i class="fas fa-heartbeat"></i></div>
<h4> New Medical State</h4> <h4> New Medical State</h4>
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
@{ @{
ViewData["Title"] = "Create"; ViewData["Title"] = "Create";
Layout = "_AdminLayout"; Layout = "_AdminLayout";
} }
...@@ -42,8 +41,14 @@ ...@@ -42,8 +41,14 @@
<div> <div>
<a asp-action="Index">Back to List</a> <a asp-action="Index">Back to List</a>
</div></div></div></div></div></div></section> </div>
</div>
</div>
</div>
</div>
</div>
</section>
@section Scripts { @section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");} @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} }
...@@ -3,27 +3,34 @@ ...@@ -3,27 +3,34 @@
@{ @{
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";
ViewData["Controller"] = "Ingredient";
Layout = "_AdminLayout";
} }
<h1>Delete</h1> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</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">
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3> <h3>Are you sure you want to delete this?</h3>
<div> <div>
<h4>Ingredient</h4> <h4>Ingredient</h4>
<hr /> <hr />
<dl class="row"> <dl class="row">
<dt class = "col-sm-2"> <dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Name) @Html.DisplayNameFor(model => model.Name)
</dt> </dt>
<dd class = "col-sm-10"> <dd class="col-sm-10">
@Html.DisplayFor(model => model.Name) @Html.DisplayFor(model => model.Name)
</dd> </dd>
<dt class = "col-sm-2"> <dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Description) @Html.DisplayNameFor(model => model.Description)
</dt> </dt>
<dd class = "col-sm-10"> <dd class="col-sm-10">
@Html.DisplayFor(model => model.Description) @Html.DisplayFor(model => model.Description)
</dd> </dd>
...@@ -34,4 +41,5 @@ ...@@ -34,4 +41,5 @@
<input type="submit" value="Delete" class="btn btn-danger" /> | <input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a> <a asp-action="Index">Back to List</a>
</form> </form>
</div> </div>
</div>
\ No newline at end of file
...@@ -17,9 +17,8 @@ ...@@ -17,9 +17,8 @@
alt="Avatar" class="img-fluid my-5" style="width: 80px;" /> alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<h5>@Model.Name</h5> <h5>@Model.Name</h5>
<a asp-action="Edit" asp-route-id="@Model.Id"> <button class="btn btn-warning btn-edit" data-id="@Model.Id">Edit</button>
<i class="far fa-edit mb-5"></i> <button class="btn btn-danger btn-delete" data-id="@Model.Id">Delete</button>
</a>
<a asp-action="Index"> <a asp-action="Index">
...@@ -49,3 +48,26 @@ ...@@ -49,3 +48,26 @@
</div> </div>
</div> </div>
</section> </section>
<div class="modal fade" id="modal-edit" tabindex="-1" role="dialog" aria-labelledby="modalEditLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- Content loaded via AJAX -->
</div>
</div>
</div>
@section scripts {
<script>
$(document).ready(function () {
// Load the Edit form in the modal
$('.btn-edit').on('click', function () {
var id = $(this).data('id');
$('#modal-edit').find('.modal-content').load('/Ingredient/Dummy/' + id);
$('#modal-edit').modal('show');
});
});
</script>
}
...@@ -2,16 +2,19 @@ ...@@ -2,16 +2,19 @@
@{ @{
ViewData["Title"] = "Edit"; ViewData["Title"] = "Edit";
Layout = "_AdminLayout";
} }
<div style="padding:120px ;">
<h1>Edit</h1>
<h4>Project</h4> <div class="modal-header">
<hr /> <h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<div class="row p-120"> <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="row ">
<div class="col-md-4"> <div class="col-md-4">
<form asp-action="Edit" class="form-group "> <form asp-action="Edit" class="form-group ">
<div asp-validation-summary="ModelOnly" class="text-danger"></div> <div asp-validation-summary="ModelOnly" class="text-danger"></div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
@{ @{
ViewData["Title"] = "Index"; ViewData["Title"] = "Index";
ViewData["Controller"] = "Ingredient";
Layout = "_AdminLayout"; Layout = "_AdminLayout";
} }
...@@ -74,9 +74,10 @@ ...@@ -74,9 +74,10 @@
</td> </td>
<td> <td>
<a asp-action="Edit" asp-controller="Ingredient" asp-route-id="@item.Id"><i class="far fa-pen-to-square text-bg-info"></i></a> <button class="btn btn-warning btn-edit" data-id="@item.Id">Edit</button>
<button class="btn btn-danger btn-delete" data-id="@item.Id">Delete</button>
<a asp-action="Details" asp-controller="Ingredient" asp-route-id="@item.Id"><i class="far fa-address-card"></i></a> <a asp-action="Details" asp-controller="Ingredient" asp-route-id="@item.Id"><i class="far fa-address-card"></i></a>
<a asp-action="Delete" asp-controller="Ingredient" asp-route-id="@item.Id"><i class="far fa-trash-can text-bg-danger"></i></a>
</td> </td>
</tr> </tr>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
@{ @{
ViewData["Title"] = "Create"; ViewData["Title"] = "Create";
ViewData["Controller"] = "MedicalState";
} }
......
...@@ -6,11 +6,15 @@ ...@@ -6,11 +6,15 @@
} }
<section class="page-section" style="background-color: #f4f5f7;"> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</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 py-5 h-100"> <div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100"> <div class="row d-flex justify-content-center align-items-center h-100">
<div class="col col-8 col-lg-8 mb-4 mb-lg-0">
<div class="card mb-3" style="border-radius: .5rem;">
<h1>Delete</h1> <h1>Delete</h1>
...@@ -45,4 +49,6 @@ ...@@ -45,4 +49,6 @@
<a asp-action="Index">Back to List</a> <a asp-action="Index">Back to List</a>
</form> </form>
</div> </div>
</div></div></div></div></section>
\ No newline at end of file </div>
</div></div>
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
@{ @{
ViewData["Title"] = "Medical State Details "; ViewData["Title"] = "Medical State Details ";
ViewData["Controller"] = "MedicalState";
var a = 0; var a = 0;
...@@ -21,9 +22,6 @@ ...@@ -21,9 +22,6 @@
</div> </div>
<h5>@Model.StateName</h5> <h5>@Model.StateName</h5>
<p>AT: @(Model.PrescriptionTime )</p> <p>AT: @(Model.PrescriptionTime )</p>
<a asp-action="Edit" asp-controller="MedicalState" asp-route-id="@Model.Id">
<i class="far fa-edit mb-5"></i>
</a>
<a asp-action="Index"> <a asp-action="Index">
...@@ -45,9 +43,8 @@ ...@@ -45,9 +43,8 @@
<div class="col-4 mb-3"> <div class="col-4 mb-3">
<h6>Medicines Count:@Model.Medicines.Count()</h6> <h6>Medicines Count:@Model.Medicines.Count()</h6>
<a class="btn btn-primary m-1" asp-controller="MedicalState" asp-action="Edit" asp-route-id="@Model.Id">Edit</a> <button class="btn btn-warning btn-edit" data-id="@Model.Id">Edit</button>
<a class="btn btn-danger m-1" asp-controller="MedicalState" asp-action="Delete" asp-route-id="@Model.Id">Delete</a> <button class="btn btn-danger btn-delete" data-id="@Model.Id">Delete</button>
<button class="btn btn-danger" ondblclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete @Model.StateName From your medical Cases", "Reomve",@Model.Id)'>Delete Confirm</button>
</div> </div>
</div> </div>
...@@ -57,7 +54,7 @@ ...@@ -57,7 +54,7 @@
<table id="Ingredients_" class="table table-bordered"> <table id="Ingredients_" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<td>#</td> <td>No.</td>
<td>Name</td> <td>Name</td>
<td>Description</td> <td>Description</td>
<td>Price</td> <td>Price</td>
...@@ -98,7 +95,7 @@ ...@@ -98,7 +95,7 @@
<hr /> <hr />
<div class="row pt-1"> <div class="row pt-1">
<button onclick="fetchMedicines()" class="btn btn-primary">Get All Medicine </button> <button onclick="fetchMedicines()" class="btn btn-primary">Get Medicines </button>
</div> </div>
</div> </div>
...@@ -126,7 +123,8 @@ ...@@ -126,7 +123,8 @@
</div> </div>
</div> </div>
</section> </section>
<div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog" <div id="item-container">
<div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog"
aria-hidden="true"> aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
...@@ -138,9 +136,9 @@ ...@@ -138,9 +136,9 @@
</button> </button>
</div> </div>
<div class="modal-body text-start p-3"> <div class="modal-body text-start p-3">
<h5 class="modal-title text-uppercase mb-5" id="exampleModalLabel">title</h5> <h5 class="modal-title text-uppercase mb-5" id="exampleModalLabel">${title}</h5>
<p class=" mb-5"> message</p> <p class=" mb-5"> ${message}</p>
<hr class="mt-2 mb-4" <hr class="mt-2 mb-4"
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;"> style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
...@@ -151,7 +149,7 @@ ...@@ -151,7 +149,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div></div>
@section Scripts { @section Scripts {
<script> <script>
async function fetchMedicines() { async function fetchMedicines() {
...@@ -169,7 +167,7 @@ ...@@ -169,7 +167,7 @@
} }
} }
async function updateMedicines() { async function updateMedicines() {
let id =@Model.Id let id =@Model.Id;
try { try {
debugger debugger
...@@ -268,7 +266,7 @@ ...@@ -268,7 +266,7 @@
} }
} }
async function DetailMedicine(med) { async function DetailMedicine(med) {
let id =@Model.Id let id =@Model.Id;
try { try {
debugger debugger
let response = await fetch(`/MedicalState/GetDetails/${med}`, { let response = await fetch(`/MedicalState/GetDetails/${med}`, {
...@@ -292,8 +290,8 @@ ...@@ -292,8 +290,8 @@
} }
} }
async function ReomveMedicine(med) { async function ReomveMedicine(med) {
let id =@Model.Id let id =@Model.Id;
debugger debugger;
try { try {
// showToast('Loading ... ', 'Removing medicine'); // showToast('Loading ... ', 'Removing medicine');
...@@ -348,7 +346,7 @@ ...@@ -348,7 +346,7 @@
} }
async function DeleteConfirm(title, message, action,param) { async function DeleteConfirm(title, message, action,param) {
debugger debugger
const modalBody = document.querySelector('#mod'); const modalBody = document.querySelector('#item-container');
modalBody.innerHTML = ` modalBody.innerHTML = `
<div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog" <div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog"
aria-hidden="true"> aria-hidden="true">
...@@ -383,12 +381,14 @@ ...@@ -383,12 +381,14 @@
} }
function showToast(message, title) { function showToast(message, title) {
const Modal = new bootstrap.Modal(document.getElementById('item')); const Modal = bootstrap.Modal.getInstance(document.getElementById('item'));
// Modal.close(); // Modal.close();
if (Modal) Modal.hide(); // if (Modal) Modal.hide();
// Modal.toggle(); // Modal.toggle();
//Modal.dispose(); Modal.dispose();
const modalBody = document.querySelector('#item'); const emedicineModal = new bootstrap.Modal(document.getElementById('item'));
emedicineModal.hide();
const modalBody = document.querySelector('#item-container');
modalBody.innerHTML = ` modalBody.innerHTML = `
<div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog" <div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog"
aria-hidden="true"> aria-hidden="true">
...@@ -418,14 +418,15 @@ ...@@ -418,14 +418,15 @@
// Show the modal // Show the modal
const medicineModal = new bootstrap.Modal(document.getElementById('item')); const medicineModal = new bootstrap.Modal(document.getElementById('item'));
medicineModal.show(); medicineModal.show();
// let c = document.getElementById('item')
// c.classList.add('show')
} }
function showModal(message, result) { function showModal(message, result) {
debugger debugger
const Modal = new bootstrap.Modal(document.getElementById('item')); // const Modal = new bootstrap.Modal(document.getElementById('item'));
// Modal.close(); // Modal.close();
try { Modal.hide(); } catch { } // try { Modal.hide(); } catch { }
let m = result["manufactureName"] let m = result["manufactureName"]
console.log(m) console.log(m)
...@@ -444,7 +445,7 @@ ...@@ -444,7 +445,7 @@
<p class="text-muted mb-0">${s[i].ratio}</p> <p class="text-muted mb-0">${s[i].ratio}</p>
</div> </div>
`} `}
const modalBody = document.querySelector('#item'); const modalBody = document.querySelector('#item-container');
modalBody.innerHTML = ` modalBody.innerHTML = `
<div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog" <div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog"
aria-hidden="true"> aria-hidden="true">
......
...@@ -6,11 +6,16 @@ ...@@ -6,11 +6,16 @@
} }
<section class="page-section" style="background-color: #f4f5f7;">
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</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 py-5 h-100"> <div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100"> <div class="row d-flex justify-content-center align-items-center h-100">
<div class="col col-8 col-lg-8 mb-4 mb-lg-0 p-4">
<div class="card mb-3" style="border-radius: .5rem;">
<form asp-action="Edit" asp-controller="MedicalState"> <form asp-action="Edit" asp-controller="MedicalState">
<div asp-validation-summary="ModelOnly" class="text-danger"></div> <div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group"> <div class="form-group">
...@@ -27,7 +32,7 @@ ...@@ -27,7 +32,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="StateDescription" class="control-label"></label> <label asp-for="StateDescription" class="control-label"></label>
<textarea asp-for="StateDescription" class="form-control" > <textarea asp-for="StateDescription" class="form-control">
</textarea> </textarea>
<span asp-validation-for="StateDescription" class="text-danger"></span> <span asp-validation-for="StateDescription" class="text-danger"></span>
...@@ -37,6 +42,8 @@ ...@@ -37,6 +42,8 @@
<div class="form-group"> <div class="form-group">
<input hidden value="@ViewBag.id" name="pId" /> <input hidden value="@ViewBag.id" name="pId" />
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<input type="submit" value="Save" class="btn btn-primary" /> <input type="submit" value="Save" class="btn btn-primary" />
</div> </div>
<input hidden value="@Model.PatientId" asp-for="@Model.PatientId" /> <input hidden value="@Model.PatientId" asp-for="@Model.PatientId" />
...@@ -48,8 +55,6 @@ ...@@ -48,8 +55,6 @@
</div> </div>
</div> </div>
</div>
</section>
@section Scripts { @section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");} @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
@{ @{
ViewData["Title"] = "Medical states "; ViewData["Title"] = "Medical states ";
ViewData["Controller"] = "MedicalState";
} }
<section class="page-section"> <section class="page-section">
<h3>Create New <a asp-action="Create" asp-controller="MedicalState">Create</a></h3> <h3>Create New <a asp-action="Create" asp-controller="MedicalState">Create</a></h3>
......
...@@ -3,14 +3,22 @@ ...@@ -3,14 +3,22 @@
@{ @{
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";
ViewData["Controller"] = "Medicine";
Layout = "_AdminLayout";
} }
<h1>Delete</h1> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</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">
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3> <h3>Are you sure you want to delete this?</h3>
<div> <div>
<h4>Medicine</h4> <h4>Medicine</h4>
<hr /> <hr />
<dl class="row"> <dl class="row">
...@@ -45,4 +53,5 @@ ...@@ -45,4 +53,5 @@
<input type="submit" value="Delete" class="btn btn-danger" /> | <input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a> <a asp-action="Index">Back to List</a>
</form> </form>
</div> </div>
</div>
\ No newline at end of file
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
@{ @{
ViewData["Title"] = "Medicine Details "; ViewData["Title"] = "Medicine Details ";
ViewData["Controller"] = "Medicine";
Layout = "_AdminLayout"; Layout = "_AdminLayout";
var a = 0; var a = 0;
} }
<section class="page-section"> <section class="page-section">
<div class="container h-100"> <div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100"> <div class="row d-flex justify-content-center align-items-center h-100">
...@@ -18,10 +19,8 @@ ...@@ -18,10 +19,8 @@
alt="Avatar" class="img-fluid my-5" style="width: 80px;" /> alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<h5>@Model.TradeName</h5> <h5>@Model.TradeName</h5>
<p>Category: @(Model.Category is null ? "":Model.Category.Name)</p> <p>Category: @(Model.Category is null ? "":Model.Category.Name)</p>
<a asp-action="Edit" asp-route-id="@Model.Id"> <button class="btn btn-warning btn-edit" data-id="@Model.Id">Edit</button>
<i class="far fa-edit mb-5"></i> <button class="btn btn-danger btn-delete" data-id="@Model.Id">Delete</button>
</a>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<div class="card-body p-4"> <div class="card-body p-4">
...@@ -47,18 +46,20 @@ ...@@ -47,18 +46,20 @@
<td>#</td> <td>#</td>
<td>Name</td> <td>Name</td>
<td>Description</td> <td>Description</td>
<td>Ratio</td>
<td>Manage</td> <td>Manage</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach (var ing in Model.Ingredients) @foreach (var ing in Model.MedicineIngredients)
{ {
<tr class=" mb-3"> <tr class=" mb-3">
<td>@(a+=1)</td> <td>@(a+=1)</td>
<td>@ing.Name</td> <td>@ing.Ingredient.Name</td>
<td>@ing.Description</td> <td>@ing.Ingredient.Description</td>
<td>@ing.Ratio</td>
<td> <td>
<button class="btn btn-danger" ondblclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete @ing.Name From this medicine", "ReomveIngredient",@ing.Id)'>Delete</button> <button class="btn btn-danger" ondblclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete @ing.Ingredient.Name From this medicine", "ReomveIngredient",@ing.Id)'>Delete</button>
</td> </td>
</tr> </tr>
...@@ -124,11 +125,12 @@ ...@@ -124,11 +125,12 @@
} }
async function updateIngredients() { async function updateIngredients() {
let id =@Model.Id; let id =@Model.Id;
debugger;
try { try {
let response = await fetch(`/Ingredient/GetIngredients`); // Adjust the endpoint as needed let response = await fetch(`/Medicine/GetDetails/${id}`); // Adjust the endpoint as needed
if (response.ok) { if (response.ok) {
let medicines = await response.json(); let medicines = await response.json();
medicines = medicines.medicineIngredients
populateTable(medicines, 'Ingredients_'); populateTable(medicines, 'Ingredients_');
} else { } else {
console.error('Error:', response.statusText); console.error('Error:', response.statusText);
...@@ -148,6 +150,7 @@ ...@@ -148,6 +150,7 @@
<tr> <tr>
<td>Name</td> <td>Name</td>
<td>Description</td> <td>Description</td>
${tableName=="t" ?" ":"<td>Ratio</td>"}
<td>Manage</td> <td>Manage</td>
</tr> </tr>
...@@ -162,6 +165,7 @@ ...@@ -162,6 +165,7 @@
row.innerHTML = ` row.innerHTML = `
<td>${medicine.name}</td> <td>${medicine.name}</td>
<td>${medicine.description}</td> <td>${medicine.description}</td>
${tableName == "t" ? " " : medicine.ratio}
`; `;
row.innerHTML += row.innerHTML +=
(tableName != "t") ? (tableName != "t") ?
...@@ -219,7 +223,7 @@ ...@@ -219,7 +223,7 @@
} }
async function addIngredientT(med) { async function addIngredientT(med) {
let id =@Model.Id let id =@Model.Id;
try { try {
var r = document.getElementById('r').value; var r = document.getElementById('r').value;
console.log(r) console.log(r)
...@@ -246,7 +250,7 @@ ...@@ -246,7 +250,7 @@
} }
} }
async function DetailMedicine(med) { async function DetailMedicine(med) {
let id =@Model.Id let id =@Model.Id;
try { try {
debugger debugger
let response = await fetch(`/Medicine/GetDetails/${med}`, { let response = await fetch(`/Medicine/GetDetails/${med}`, {
...@@ -271,9 +275,9 @@ ...@@ -271,9 +275,9 @@
} }
async function ReomveIngredient(med) { async function ReomveIngredient(med) {
let id =@Model.Id let id =@Model.Id;
try { try {
showToast('Loading ... ', 'Removing medicine'); /// showToast('Loading ... ', 'Removing medicine');
let response = await fetch(`/Medicine/ReomveIngredient`, { let response = await fetch(`/Medicine/ReomveIngredient`, {
method: 'POST', method: 'POST',
...@@ -286,7 +290,7 @@ ...@@ -286,7 +290,7 @@
if (response.ok) { if (response.ok) {
let result = await response.json(); let result = await response.json();
updateMedicines(); updateIngredients();
showToast('Medicine Reomved successfully', 'Success'); showToast('Medicine Reomved successfully', 'Success');
} else { } else {
......
@model MedicineModel; @model MedicineModel;
@{ @*@{
ViewData["Title"] = "Edit"; ViewData["Title"] = "Edit";
Layout = "_AdminLayout"; Layout = "_AdminLayout";
} }*@
<div style="padding:120px ;"> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<h1>Edit</h1> <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
<h4>Project</h4> </button>
<hr /> </div>
<div class="row p-120"> <div class="modal-body">
<div class="col-md-4"> <div class="row">
<div class="col-md-10 offset-1">
<form asp-action="Edit" class="form-group "> <form asp-action="Edit" class="form-group ">
<div asp-validation-summary="ModelOnly" class="text-danger"></div> <div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group row"> <div class="form-group row">
...@@ -84,17 +85,18 @@ ...@@ -84,17 +85,18 @@
<input type="hidden" asp-for="Id" /> <input type="hidden" asp-for="Id" />
<div class="form-group"> <div class="form-group">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<input type="submit" value="Save" class="btn btn-primary" /> <input type="submit" value="Save" class="btn btn-primary" />
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<div>
<a asp-action="Index">Back to List</a>
</div>
</div> </div>
@section Scripts { @section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");} @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
@{ @{
ViewData["Title"] = "Index"; ViewData["Title"] = "Index";
ViewData["Controller"] = "Medicine";
Layout = "_AdminLayout"; Layout = "_AdminLayout";
} }
...@@ -100,13 +101,14 @@ ...@@ -100,13 +101,14 @@
@Html.DisplayFor(modelItem => item.Price) @Html.DisplayFor(modelItem => item.Price)
</td> </td>
<td> <td>
<a asp-action="Edit" asp-controller="Medicine" asp-route-id="@item.Id"><i class="far fa-pen-to-square text-bg-info"></i></a>
<button class="btn btn-warning btn-edit" data-id="@item.Id">Edit</button>
<button class="btn btn-danger btn-delete" data-id="@item.Id">Delete</button>
<a asp-action="Details" asp-controller="Medicine" asp-route-id="@item.Id"><i class="far fa-address-card"></i></a> <a asp-action="Details" asp-controller="Medicine" asp-route-id="@item.Id"><i class="far fa-address-card"></i></a>
<a asp-action="Delete" asp-controller="Medicine" asp-route-id="@item.Id"><i class="far fa-trash-can text-bg-danger"></i></a>
</td> </td>
</tr> </tr>
} }
</tbody> </tbody>
</table> </table>
</div> </div>
@model int
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form asp-action="Dummy" method="post">
<input value="@Model" name="id" />
<input value="@Model" name="s" />
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" /> <link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" />
<link href="/css/styles.css" rel="stylesheet" /> <link href="/css/styles.css" rel="stylesheet" />
<link href="/favicon.png" rel="icon"> <link href="/favicon.png" rel="icon">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Custom fonts for this theme --> <!-- Custom fonts for this theme -->
<link href="~/fonts/css/all.min.css" rel="stylesheet" type="text/css"> <link href="~/fonts/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
...@@ -162,6 +164,44 @@ ...@@ -162,6 +164,44 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
@RenderSection("Scripts", required: false); @RenderSection("Scripts", required: false);
<div class="modal fade" id="modal-delete" tabindex="-1" role="dialog" aria-labelledby="modalDeleteLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- Content loaded via AJAX -->
</div>
</div>
</div>
<div class="modal fade" id="modal-edit" tabindex="-1" role="dialog" aria-labelledby="modalCreateLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- Content loaded via AJAX -->
</div>
</div>
</div>
<script>
$(document).ready(function () {
// Load the Edit form in the modal
$('.btn-edit').on('click', function () {
var id = $(this).data('id');
var controller = `@ViewData["Controller"]`;
$('#modal-edit').find('.modal-content').load(`/${controller}/Edit/` + id);
$('#modal-edit').modal('show');
});
$('.btn-delete').on('click', function () {
var id = $(this).data('id');
var controller = `@ViewData["Controller"]`;
$('#modal-delete').find('.modal-content').load(`/${controller}/Delete/` + id);
$('#modal-delete').modal('show');
});
});
</script>
<!-- Bootstrap core JavaScript --> <!-- Bootstrap core JavaScript -->
<script src="~/js/jquery.min.js"></script> <script src="~/js/jquery.min.js"></script>
<script src="~/js/bootstrap.bundle.min.js"></script> <script src="~/js/bootstrap.bundle.min.js"></script>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" asp-action="Index" asp-controller="MedicalState">Medicines</a> <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" asp-action="Index" asp-controller="MedicalState">Medicines</a>
</li> </li>
<li class="nav-item mx-0 mx-lg-1"> <li class="nav-item mx-0 mx-lg-1">
<a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger"asp-action="Index" asp-controller="Home">Home</a> <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" asp-action="Index" asp-controller="Home">Home</a>
</li> </li>
<partial name="_LoginPartial" /> <partial name="_LoginPartial" />
...@@ -131,6 +131,41 @@ ...@@ -131,6 +131,41 @@
<!-- Custom scripts for this template --> <!-- Custom scripts for this template -->
<script src="~/js/freelancer.min.js"></script> <script src="~/js/freelancer.min.js"></script>
@RenderSection("Scripts", required: false) @RenderSection("Scripts", required: false)
<div class="modal fade" id="modal-delete" tabindex="-1" role="dialog" aria-labelledby="modalDeleteLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- Content loaded via AJAX -->
</div>
</div>
</div>
<div class="modal fade" id="modal-edit" tabindex="-1" role="dialog" aria-labelledby="modalCreateLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- Content loaded via AJAX -->
</div>
</div>
</div>
<script>
$(document).ready(function () {
// Load the Edit form in the modal
$('.btn-edit').on('click', function () {
var id = $(this).data('id');
var controller = `@ViewData["Controller"]`;
$('#modal-edit').find('.modal-content').load(`/${controller}/Edit/` + id);
$('#modal-edit').modal('show');
});
$('.btn-delete').on('click', function () {
var id = $(this).data('id');
var controller = `@ViewData["Controller"]`;
$('#modal-delete').find('.modal-content').load(`/${controller}/Delete/` + id);
$('#modal-delete').modal('show');
});
});
</script>
</body> </body>
</html> </html>
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "e6911b7e947142b30f1a3f9749d60796b8ca6d3b" #pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "dfd75e11456c647b0b1e23e7e7e9055500ef4e69"
// <auto-generated/> // <auto-generated/>
#pragma warning disable 1591 #pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Ingredient_Delete), @"mvc.1.0.view", @"/Views/Ingredient/Delete.cshtml")] [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Ingredient_Delete), @"mvc.1.0.view", @"/Views/Ingredient/Delete.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", @"e6911b7e947142b30f1a3f9749d60796b8ca6d3b", @"/Views/Ingredient/Delete.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"dfd75e11456c647b0b1e23e7e7e9055500ef4e69", @"/Views/Ingredient/Delete.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
public class Views_Ingredient_Delete : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IngredientModel> public class Views_Ingredient_Delete : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IngredientModel>
{ {
...@@ -86,48 +86,64 @@ using System; ...@@ -86,48 +86,64 @@ using System;
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";
ViewData["Controller"] = "Ingredient";
Layout = "_AdminLayout";
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\r\n<h1>Delete</h1>\r\n\r\n<h3>Are you sure you want to delete this?</h3>\r\n<div>\r\n <h4>Ingredient</h4>\r\n <hr />\r\n <dl class=\"row\">\r\n <dt class = \"col-sm-2\">\r\n "); WriteLiteral(@"
<div class=""modal-header"">
<h5 class=""modal-title"" id=""modalEditLabel"">Edit Medicine</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"">
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Ingredient</h4>
<hr />
<dl class=""row"">
<dt class=""col-sm-2"">
");
#nullable restore #nullable restore
#line 18 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" #line 25 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml"
Write(Html.DisplayNameFor(model => model.Name)); Write(Html.DisplayNameFor(model => model.Name));
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#nullable restore #nullable restore
#line 21 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" #line 28 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml"
Write(Html.DisplayFor(model => model.Name)); Write(Html.DisplayFor(model => model.Name));
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n ");
#nullable restore #nullable restore
#line 24 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" #line 31 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml"
Write(Html.DisplayNameFor(model => model.Description)); Write(Html.DisplayNameFor(model => model.Description));
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#nullable restore #nullable restore
#line 27 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" #line 34 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml"
Write(Html.DisplayFor(model => model.Description)); Write(Html.DisplayFor(model => model.Description));
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\r\n </dd>\r\n \r\n </dl>\r\n \r\n "); WriteLiteral("\r\n </dd>\r\n\r\n </dl>\r\n\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e6911b7e947142b30f1a3f9749d60796b8ca6d3b6636", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "dfd75e11456c647b0b1e23e7e7e9055500ef4e697003", async() => {
WriteLiteral("\r\n "); WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "e6911b7e947142b30f1a3f9749d60796b8ca6d3b6902", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "dfd75e11456c647b0b1e23e7e7e9055500ef4e697273", async() => {
} }
); );
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
...@@ -135,7 +151,7 @@ using System; ...@@ -135,7 +151,7 @@ using System;
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_0.Value; __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_0.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#nullable restore #nullable restore
#line 33 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" #line 40 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Id); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Id);
#line default #line default
...@@ -150,7 +166,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid ...@@ -150,7 +166,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
Write(__tagHelperExecutionContext.Output); Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End(); __tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n <input type=\"submit\" value=\"Delete\" class=\"btn btn-danger\" /> |\r\n "); WriteLiteral("\r\n <input type=\"submit\" value=\"Delete\" class=\"btn btn-danger\" /> |\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e6911b7e947142b30f1a3f9749d60796b8ca6d3b8684", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "dfd75e11456c647b0b1e23e7e7e9055500ef4e699063", async() => {
WriteLiteral("Back to List"); WriteLiteral("Back to List");
} }
); );
...@@ -181,7 +197,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid ...@@ -181,7 +197,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
} }
Write(__tagHelperExecutionContext.Output); Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End(); __tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n</div>\r\n"); WriteLiteral("\r\n </div>\r\n </div>");
} }
#pragma warning restore 1998 #pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
......
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6645dec332594b6d383843d6368f2ab2cb3542b3" #pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "4c7a88df4601bdbe63a0ddbb814b15b54b65eb06"
// <auto-generated/> // <auto-generated/>
#pragma warning disable 1591 #pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_Delete), @"mvc.1.0.view", @"/Views/Medicine/Delete.cshtml")] [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_Delete), @"mvc.1.0.view", @"/Views/Medicine/Delete.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", @"6645dec332594b6d383843d6368f2ab2cb3542b3", @"/Views/Medicine/Delete.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4c7a88df4601bdbe63a0ddbb814b15b54b65eb06", @"/Views/Medicine/Delete.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_Delete : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MedicineModel> public class Views_Medicine_Delete : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MedicineModel>
{ {
...@@ -86,15 +86,32 @@ using System; ...@@ -86,15 +86,32 @@ using System;
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";
ViewData["Controller"] = "Medicine";
Layout = "_AdminLayout";
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\r\n<h1>Delete</h1>\r\n\r\n<h3>Are you sure you want to delete this?</h3>\r\n<div>\r\n <h4>Medicine</h4>\r\n <hr />\r\n <dl class=\"row\">\r\n <dt class=\"col-sm-2\">\r\n "); WriteLiteral(@"
<div class=""modal-header"">
<h5 class=""modal-title"" id=""modalEditLabel"">Edit Medicine</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"">
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Medicine</h4>
<hr />
<dl class=""row"">
<dt class=""col-sm-2"">
");
#nullable restore #nullable restore
#line 18 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 26 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
Write(Html.DisplayNameFor(model => model.TradeName)); Write(Html.DisplayNameFor(model => model.TradeName));
#line default #line default
...@@ -102,7 +119,7 @@ using System; ...@@ -102,7 +119,7 @@ using System;
#nullable disable #nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n "); WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#nullable restore #nullable restore
#line 21 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 29 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
Write(Html.DisplayFor(model => model.TradeName)); Write(Html.DisplayFor(model => model.TradeName));
#line default #line default
...@@ -110,7 +127,7 @@ using System; ...@@ -110,7 +127,7 @@ using System;
#nullable disable #nullable disable
WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n "); WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n ");
#nullable restore #nullable restore
#line 24 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 32 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
Write(Html.DisplayNameFor(model => model.Description)); Write(Html.DisplayNameFor(model => model.Description));
#line default #line default
...@@ -118,7 +135,7 @@ using System; ...@@ -118,7 +135,7 @@ using System;
#nullable disable #nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n "); WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#nullable restore #nullable restore
#line 27 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 35 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
Write(Html.DisplayFor(model => model.Description)); Write(Html.DisplayFor(model => model.Description));
#line default #line default
...@@ -126,7 +143,7 @@ using System; ...@@ -126,7 +143,7 @@ using System;
#nullable disable #nullable disable
WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n "); WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n ");
#nullable restore #nullable restore
#line 30 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 38 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
Write(Html.DisplayNameFor(model => model.Category.Name)); Write(Html.DisplayNameFor(model => model.Category.Name));
#line default #line default
...@@ -134,7 +151,7 @@ using System; ...@@ -134,7 +151,7 @@ using System;
#nullable disable #nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n "); WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#nullable restore #nullable restore
#line 33 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 41 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
Write(Html.DisplayFor(model => model.Category.Name)); Write(Html.DisplayFor(model => model.Category.Name));
#line default #line default
...@@ -142,7 +159,7 @@ using System; ...@@ -142,7 +159,7 @@ using System;
#nullable disable #nullable disable
WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n "); WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n ");
#nullable restore #nullable restore
#line 36 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 44 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
Write(Html.DisplayNameFor(model => model.Price)); Write(Html.DisplayNameFor(model => model.Price));
#line default #line default
...@@ -150,16 +167,16 @@ using System; ...@@ -150,16 +167,16 @@ using System;
#nullable disable #nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n "); WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#nullable restore #nullable restore
#line 39 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 47 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
Write(Html.DisplayFor(model => model.Price)); Write(Html.DisplayFor(model => model.Price));
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\r\n </dd>\r\n </dl>\r\n\r\n "); WriteLiteral("\r\n </dd>\r\n </dl>\r\n\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6645dec332594b6d383843d6368f2ab2cb3542b37853", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "4c7a88df4601bdbe63a0ddbb814b15b54b65eb068311", async() => {
WriteLiteral("\r\n "); WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "6645dec332594b6d383843d6368f2ab2cb3542b38119", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "4c7a88df4601bdbe63a0ddbb814b15b54b65eb068581", async() => {
} }
); );
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>(); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
...@@ -167,7 +184,7 @@ using System; ...@@ -167,7 +184,7 @@ using System;
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_0.Value; __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_0.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#nullable restore #nullable restore
#line 44 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" #line 52 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml"
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Id); __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Id);
#line default #line default
...@@ -182,7 +199,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid ...@@ -182,7 +199,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
Write(__tagHelperExecutionContext.Output); Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End(); __tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n <input type=\"submit\" value=\"Delete\" class=\"btn btn-danger\" /> |\r\n "); WriteLiteral("\r\n <input type=\"submit\" value=\"Delete\" class=\"btn btn-danger\" /> |\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6645dec332594b6d383843d6368f2ab2cb3542b39899", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "4c7a88df4601bdbe63a0ddbb814b15b54b65eb0610369", async() => {
WriteLiteral("Back to List"); WriteLiteral("Back to List");
} }
); );
...@@ -213,7 +230,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid ...@@ -213,7 +230,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
} }
Write(__tagHelperExecutionContext.Output); Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End(); __tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n</div>\r\n"); WriteLiteral("\r\n </div>\r\n </div>");
} }
#pragma warning restore 1998 #pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
......
3469560838cd75d70e568e4424234b353b628d37 8e5a517f0a4ac63a4968f851b712f61e17384fbf
...@@ -184,3 +184,4 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.ge ...@@ -184,3 +184,4 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.ge
C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\Microsoft.AspNetCore.JsonPatch.dll C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\Microsoft.AspNetCore.JsonPatch.dll
C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll
C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\Newtonsoft.Json.Bson.dll C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\Newtonsoft.Json.Bson.dll
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Shared\Dummy.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