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

add partial views

parent 0aec6304
......@@ -22,6 +22,18 @@ namespace WebPresentation.Controllers
_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)
{
......@@ -49,7 +61,7 @@ namespace WebPresentation.Controllers
return View("NotFound");
}
return View(TModel);
return PartialView(TModel);
}
public async virtual Task<IActionResult> Index()
......@@ -80,7 +92,7 @@ namespace WebPresentation.Controllers
{
return View("NotFound");
}
return View(tModel);
return PartialView(tModel);
}
[HttpPost]
......@@ -107,7 +119,7 @@ namespace WebPresentation.Controllers
}
return RedirectToAction("Details",new { id=tModel.Id});
}
return View(tModel);
return PartialView(tModel);
}
public IActionResult Create()
......
......@@ -26,5 +26,7 @@ namespace WebPresentation.Controllers
return Ok(s);
}
}
}
......@@ -51,12 +51,7 @@ namespace WebPresentation.Controllers
if (ModelState.IsValid)
{
var uId = GetUserId();
var p = _patientService.GetAll(
).Result
.Where(
u => u.User.Id == uId
)
.FirstOrDefault().Id;
var p = _patientService.GetByUserId(uId).Id;
if (medicalState.PrescriptionTime == DateTime.MinValue )
medicalState.PrescriptionTime = DateTime.Now;
var n= ((IMedicalStateService)_service).AddToPateint(p,medicalState);
......@@ -150,7 +145,6 @@ namespace WebPresentation.Controllers
public JsonResult GetMedicines()
{
var all = _medicineService.GetAll().Result;
return new JsonResult(all);
}
......
......@@ -13,19 +13,14 @@ namespace WebPresentation.Controllers
public class MedicineController : CRUDController<MedicineModel>
{
private readonly IIngredientService _ingredientService;
private readonly IMedicineService _medicineService;
private readonly IPatientService _patientService;
public MedicineController(UserManager<User> userManager,
IMedicineService medicineService ,
IIngredientService ingredientService ,
IPatientService patientService
IIngredientService ingredientService
):base(userManager ,medicineService)
{
_ingredientService =ingredientService;
_medicineService = medicineService;
_patientService =patientService;
}
......@@ -34,9 +29,9 @@ namespace WebPresentation.Controllers
[Authorize(Roles = "Admin")]
[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" });
}
......
......@@ -15,6 +15,7 @@
ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName;
ViewBag.Avatar = Model.User.Avatar;
ViewData["Controller"] = "Home";
ViewBag.owner = Model;
var DummyModel = new MedicalState { StateName="state name" , StateDescription="Description" , PrescriptionTime=DateTime.Now};
......@@ -55,7 +56,7 @@
<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"><i class="fas fa-heartbeat"></i></div>
<h4> New Medical State</h4>
......
......@@ -2,9 +2,8 @@
@{
ViewData["Title"] = "Create";
Layout = "_AdminLayout";
}
......@@ -42,8 +41,14 @@
<div>
<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");}
}
}
......@@ -3,27 +3,34 @@
@{
ViewData["Title"] = "Delete";
Layout = "_AdminLayout";
ViewData["Controller"] = "Ingredient";
}
<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>
<div>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Ingredient</h4>
<hr />
<dl class="row">
<dt class = "col-sm-2">
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Name)
</dt>
<dd class = "col-sm-10">
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Name)
</dd>
<dt class = "col-sm-2">
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Description)
</dt>
<dd class = "col-sm-10">
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Description)
</dd>
......@@ -34,4 +41,5 @@
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
</form>
</div>
</div>
</div>
\ No newline at end of file
......@@ -17,9 +17,8 @@
alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<h5>@Model.Name</h5>
<a asp-action="Edit" asp-route-id="@Model.Id">
<i class="far fa-edit mb-5"></i>
</a>
<button class="btn btn-warning btn-edit" data-id="@Model.Id">Edit</button>
<button class="btn btn-danger btn-delete" data-id="@Model.Id">Delete</button>
<a asp-action="Index">
......@@ -49,3 +48,26 @@
</div>
</div>
</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 @@
@{
ViewData["Title"] = "Edit";
Layout = "_AdminLayout";
}
<div style="padding:120px ;">
<h1>Edit</h1>
<h4>Project</h4>
<hr />
<div class="row p-120">
<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="row ">
<div class="col-md-4">
<form asp-action="Edit" class="form-group ">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
......
......@@ -2,7 +2,7 @@
@{
ViewData["Title"] = "Index";
ViewData["Controller"] = "Ingredient";
Layout = "_AdminLayout";
}
......@@ -74,9 +74,10 @@
</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="Delete" asp-controller="Ingredient" asp-route-id="@item.Id"><i class="far fa-trash-can text-bg-danger"></i></a>
</td>
</tr>
......
......@@ -3,6 +3,7 @@
@{
ViewData["Title"] = "Create";
ViewData["Controller"] = "MedicalState";
}
......
......@@ -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="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>
......@@ -45,4 +49,6 @@
<a asp-action="Index">Back to List</a>
</form>
</div>
</div></div></div></div></section>
\ No newline at end of file
</div>
</div></div>
......@@ -3,6 +3,7 @@
@{
ViewData["Title"] = "Medical State Details ";
ViewData["Controller"] = "MedicalState";
var a = 0;
......@@ -21,9 +22,6 @@
</div>
<h5>@Model.StateName</h5>
<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">
......@@ -45,9 +43,8 @@
<div class="col-4 mb-3">
<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>
<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" ondblclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete @Model.StateName From your medical Cases", "Reomve",@Model.Id)'>Delete Confirm</button>
<button class="btn btn-warning btn-edit" data-id="@Model.Id">Edit</button>
<button class="btn btn-danger btn-delete" data-id="@Model.Id">Delete</button>
</div>
</div>
......@@ -57,7 +54,7 @@
<table id="Ingredients_" class="table table-bordered">
<thead>
<tr>
<td>#</td>
<td>No.</td>
<td>Name</td>
<td>Description</td>
<td>Price</td>
......@@ -98,7 +95,7 @@
<hr />
<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>
......@@ -126,7 +123,8 @@
</div>
</div>
</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">
<div class="modal-dialog">
<div class="modal-content">
......@@ -138,9 +136,9 @@
</button>
</div>
<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"
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
......@@ -151,7 +149,7 @@
</div>
</div>
</div>
</div>
</div></div>
@section Scripts {
<script>
async function fetchMedicines() {
......@@ -169,7 +167,7 @@
}
}
async function updateMedicines() {
let id =@Model.Id
let id =@Model.Id;
try {
debugger
......@@ -268,7 +266,7 @@
}
}
async function DetailMedicine(med) {
let id =@Model.Id
let id =@Model.Id;
try {
debugger
let response = await fetch(`/MedicalState/GetDetails/${med}`, {
......@@ -292,8 +290,8 @@
}
}
async function ReomveMedicine(med) {
let id =@Model.Id
debugger
let id =@Model.Id;
debugger;
try {
// showToast('Loading ... ', 'Removing medicine');
......@@ -348,7 +346,7 @@
}
async function DeleteConfirm(title, message, action,param) {
debugger
const modalBody = document.querySelector('#mod');
const modalBody = document.querySelector('#item-container');
modalBody.innerHTML = `
<div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog"
aria-hidden="true">
......@@ -383,12 +381,14 @@
}
function showToast(message, title) {
const Modal = new bootstrap.Modal(document.getElementById('item'));
const Modal = bootstrap.Modal.getInstance(document.getElementById('item'));
// Modal.close();
if (Modal) Modal.hide();
// if (Modal) Modal.hide();
// Modal.toggle();
//Modal.dispose();
const modalBody = document.querySelector('#item');
Modal.dispose();
const emedicineModal = new bootstrap.Modal(document.getElementById('item'));
emedicineModal.hide();
const modalBody = document.querySelector('#item-container');
modalBody.innerHTML = `
<div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog"
aria-hidden="true">
......@@ -418,14 +418,15 @@
// Show the modal
const medicineModal = new bootstrap.Modal(document.getElementById('item'));
medicineModal.show();
// let c = document.getElementById('item')
// c.classList.add('show')
}
function showModal(message, result) {
debugger
const Modal = new bootstrap.Modal(document.getElementById('item'));
// const Modal = new bootstrap.Modal(document.getElementById('item'));
// Modal.close();
try { Modal.hide(); } catch { }
// try { Modal.hide(); } catch { }
let m = result["manufactureName"]
console.log(m)
......@@ -444,7 +445,7 @@
<p class="text-muted mb-0">${s[i].ratio}</p>
</div>
`}
const modalBody = document.querySelector('#item');
const modalBody = document.querySelector('#item-container');
modalBody.innerHTML = `
<div class="modal fade" id="item" tabindex="-1" aria-labelledby="label-" role="dialog"
aria-hidden="true">
......
......@@ -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="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">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
......@@ -27,7 +32,7 @@
</div>
<div class="form-group">
<label asp-for="StateDescription" class="control-label"></label>
<textarea asp-for="StateDescription" class="form-control" >
<textarea asp-for="StateDescription" class="form-control">
</textarea>
<span asp-validation-for="StateDescription" class="text-danger"></span>
......@@ -37,6 +42,8 @@
<div class="form-group">
<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" />
</div>
<input hidden value="@Model.PatientId" asp-for="@Model.PatientId" />
......@@ -48,8 +55,6 @@
</div>
</div>
</div>
</section>
@section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
......@@ -2,7 +2,7 @@
@{
ViewData["Title"] = "Medical states ";
ViewData["Controller"] = "MedicalState";
}
<section class="page-section">
<h3>Create New <a asp-action="Create" asp-controller="MedicalState">Create</a></h3>
......
......@@ -3,14 +3,22 @@
@{
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>
<div>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Medicine</h4>
<hr />
<dl class="row">
......@@ -45,4 +53,5 @@
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
</form>
</div>
</div>
</div>
\ No newline at end of file
......@@ -2,10 +2,11 @@
@{
ViewData["Title"] = "Medicine Details ";
ViewData["Controller"] = "Medicine";
Layout = "_AdminLayout";
var a = 0;
}
<section class="page-section">
<div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
......@@ -18,10 +19,8 @@
alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<h5>@Model.TradeName</h5>
<p>Category: @(Model.Category is null ? "":Model.Category.Name)</p>
<a asp-action="Edit" asp-route-id="@Model.Id">
<i class="far fa-edit mb-5"></i>
</a>
<button class="btn btn-warning btn-edit" data-id="@Model.Id">Edit</button>
<button class="btn btn-danger btn-delete" data-id="@Model.Id">Delete</button>
</div>
<div class="col-md-8">
<div class="card-body p-4">
......@@ -47,18 +46,20 @@
<td>#</td>
<td>Name</td>
<td>Description</td>
<td>Ratio</td>
<td>Manage</td>
</tr>
</thead>
<tbody>
@foreach (var ing in Model.Ingredients)
@foreach (var ing in Model.MedicineIngredients)
{
<tr class=" mb-3">
<td>@(a+=1)</td>
<td>@ing.Name</td>
<td>@ing.Description</td>
<td>@ing.Ingredient.Name</td>
<td>@ing.Ingredient.Description</td>
<td>@ing.Ratio</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>
</tr>
......@@ -124,11 +125,12 @@
}
async function updateIngredients() {
let id =@Model.Id;
debugger;
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) {
let medicines = await response.json();
medicines = medicines.medicineIngredients
populateTable(medicines, 'Ingredients_');
} else {
console.error('Error:', response.statusText);
......@@ -148,6 +150,7 @@
<tr>
<td>Name</td>
<td>Description</td>
${tableName=="t" ?" ":"<td>Ratio</td>"}
<td>Manage</td>
</tr>
......@@ -162,6 +165,7 @@
row.innerHTML = `
<td>${medicine.name}</td>
<td>${medicine.description}</td>
${tableName == "t" ? " " : medicine.ratio}
`;
row.innerHTML +=
(tableName != "t") ?
......@@ -219,7 +223,7 @@
}
async function addIngredientT(med) {
let id =@Model.Id
let id =@Model.Id;
try {
var r = document.getElementById('r').value;
console.log(r)
......@@ -246,7 +250,7 @@
}
}
async function DetailMedicine(med) {
let id =@Model.Id
let id =@Model.Id;
try {
debugger
let response = await fetch(`/Medicine/GetDetails/${med}`, {
......@@ -271,9 +275,9 @@
}
async function ReomveIngredient(med) {
let id =@Model.Id
let id =@Model.Id;
try {
showToast('Loading ... ', 'Removing medicine');
/// showToast('Loading ... ', 'Removing medicine');
let response = await fetch(`/Medicine/ReomveIngredient`, {
method: 'POST',
......@@ -286,7 +290,7 @@
if (response.ok) {
let result = await response.json();
updateMedicines();
updateIngredients();
showToast('Medicine Reomved successfully', 'Success');
} else {
......
@model MedicineModel;
@{
@*@{
ViewData["Title"] = "Edit";
Layout = "_AdminLayout";
}
<div style="padding:120px ;">
<h1>Edit</h1>
<h4>Project</h4>
<hr />
<div class="row p-120">
<div class="col-md-4">
}*@
<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="row">
<div class="col-md-10 offset-1">
<form asp-action="Edit" class="form-group ">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group row">
......@@ -84,17 +85,18 @@
<input type="hidden" asp-for="Id" />
<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" />
</div>
</form>
</div>
</div>
<div>
<a asp-action="Index">Back to List</a>
</div>
</div>
@section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
@{
ViewData["Title"] = "Index";
ViewData["Controller"] = "Medicine";
Layout = "_AdminLayout";
}
......@@ -100,13 +101,14 @@
@Html.DisplayFor(modelItem => item.Price)
</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="Delete" asp-controller="Medicine" asp-route-id="@item.Id"><i class="far fa-trash-can text-bg-danger"></i></a>
</td>
</tr>
}
</tbody>
</table>
</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 @@
<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="/favicon.png" rel="icon">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Custom fonts for this theme -->
<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">
......@@ -162,6 +164,44 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
@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 -->
<script src="~/js/jquery.min.js"></script>
<script src="~/js/bootstrap.bundle.min.js"></script>
......
......@@ -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>
</li>
<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>
<partial name="_LoginPartial" />
......@@ -131,6 +131,41 @@
<!-- Custom scripts for this template -->
<script src="~/js/freelancer.min.js"></script>
@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>
</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/>
#pragma warning disable 1591
[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;
#line default
#line hidden
#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")]
public class Views_Ingredient_Delete : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IngredientModel>
{
......@@ -86,48 +86,64 @@ using System;
ViewData["Title"] = "Delete";
Layout = "_AdminLayout";
ViewData["Controller"] = "Ingredient";
#line default
#line hidden
#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
#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));
#line default
#line hidden
#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
#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));
#line default
#line hidden
#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
#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));
#line default
#line hidden
#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
#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));
#line default
#line hidden
#nullable disable
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() => {
WriteLiteral("\r\n </dd>\r\n\r\n </dl>\r\n\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "dfd75e11456c647b0b1e23e7e7e9055500ef4e697003", async() => {
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>();
......@@ -135,7 +151,7 @@ using System;
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_0.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#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);
#line default
......@@ -150,7 +166,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
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");
}
);
......@@ -181,7 +197,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n</div>\r\n");
WriteLiteral("\r\n </div>\r\n </div>");
}
#pragma warning restore 1998
[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/>
#pragma warning disable 1591
[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;
#line default
#line hidden
#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")]
public class Views_Medicine_Delete : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MedicineModel>
{
......@@ -86,15 +86,32 @@ using System;
ViewData["Title"] = "Delete";
ViewData["Controller"] = "Medicine";
Layout = "_AdminLayout";
#line default
#line hidden
#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
#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));
#line default
......@@ -102,7 +119,7 @@ using System;
#nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#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));
#line default
......@@ -110,7 +127,7 @@ using System;
#nullable disable
WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n ");
#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));
#line default
......@@ -118,7 +135,7 @@ using System;
#nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#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));
#line default
......@@ -126,7 +143,7 @@ using System;
#nullable disable
WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n ");
#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));
#line default
......@@ -134,7 +151,7 @@ using System;
#nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#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));
#line default
......@@ -142,7 +159,7 @@ using System;
#nullable disable
WriteLiteral("\r\n </dd>\r\n <dt class=\"col-sm-2\">\r\n ");
#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));
#line default
......@@ -150,16 +167,16 @@ using System;
#nullable disable
WriteLiteral("\r\n </dt>\r\n <dd class=\"col-sm-10\">\r\n ");
#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));
#line default
#line hidden
#nullable disable
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 ");
__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>();
......@@ -167,7 +184,7 @@ using System;
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.InputTypeName = (string)__tagHelperAttribute_0.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
#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);
#line default
......@@ -182,7 +199,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
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");
}
);
......@@ -213,7 +230,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n</div>\r\n");
WriteLiteral("\r\n </div>\r\n </div>");
}
#pragma warning restore 1998
[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
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\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