You need to sign in or sign up before continuing.
Commit ee396f8e authored by hasan khaddour's avatar hasan khaddour

Adding abstrract CRUD Controller

parent bb976d30
......@@ -8,11 +8,10 @@ namespace ApplicationCore.Interfaces
{
public interface IService<T> where T : class
{
public IEnumerable<T> GetAll();
public T Create( T entity);
public T Update(T entity);
public T GetDetails(int Id);
public void Delete(int Id);
public T Update(T tModel);
}
......
......@@ -7,13 +7,13 @@ using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IIngredientService
public interface IIngredientService : IService<Ingredient>
{
public IEnumerable<Ingredient> GetAllIngredients();
public void AddIngredient(Ingredient ingredient);
public Ingredient GetIngredientDetails(int id);
public Ingredient Update(Ingredient ingredient);
public void Delete(int id );
// public Ingredient GetIngredientDetails(int id);
// public Ingredient Update(Ingredient ingredient);
// public void Delete(int id );
}
......
......@@ -9,10 +9,14 @@ namespace ApplicationCore.Interfaces.IServices
{
public interface IMedicalStateService : IService<MedicalState>
{
public IEnumerable<MedicalState> GetAll();
public IEnumerable<MedicalState> GetAllPatientMedicalStates(int patientId);
public MedicalState Add(int patientId , MedicalState medicalState);
public void AddMedicine(int medicalStateId, int medicineId);
//public MedicalState Update(MedicalState medicalState);
public void RemoveMedicine(int medicalStateId, int medicineId);
// public MedicalState Update(MedicalState medicalState);
//public MedicalState GetDetails(int medicalStateId);
//public void Delete(int id);
......
......@@ -7,16 +7,16 @@ using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IMedicineService
public interface IMedicineService :IService<Medicine>
{
public IEnumerable<Medicine> GetAllMedicines();
public void AddMedicine(Medicine medicine);
public void AddMedicineIngredient(int medicineId, Ingredient ingredient);
public Medicine Update(Medicine medicine);
public Medicine GetMedicineDetails(int id);
// public Medicine Update(Medicine medicine);
//public Medicine GetMedicineDetails(int id);
public Medicine GetMedicineIngredentisDetails(int medicineId);
public void AddIngredient(int medicineId, int ratio, Ingredient ingredient);
public void Delete(int id);
// public void Delete(int id);
}
}
......@@ -8,17 +8,17 @@ using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IPatientService
public interface IPatientService :IService<Patient>
{
public IEnumerable<MedicalState> GetPatientMedicalStates(int patientId);
public MedicalState GetMedicalStateDetails(int id, params Expression<Func<MedicalState, object>>[] includeProperties);
public IEnumerable<Patient> GetAll(params Expression<Func<Patient, object>>[] includeProperties);
public void AddMedicalState(int patientId, MedicalState medicalState);
public Patient GetById(int id, params Expression<Func<Patient, object>>[] includeProperties);
// public Patient GetDetails(int id);
public void Insert(Patient patient);
public void Update(Patient patient);
public void Delete(int id);
// public void Update(Patient patient);
// public void Delete(int id);
public bool PatientExists(int id);
}
......
......@@ -41,7 +41,7 @@ namespace ApplicationCore.Services
return r;
}
public Ingredient GetIngredientDetails(int id)
public Ingredient GetDetails(int id)
{
return _ingredientUnitOfWork.Entity.GetById(id,
......
......@@ -53,6 +53,17 @@ namespace ApplicationCore.Services
_medicalStateUnitOfWork.Entity.Update(m);
_medicalStateUnitOfWork.Save();
}
public void RemoveMedicine(int medicalStateId, int medicineId)
{
var m = _medicalStateUnitOfWork.Entity.GetById(medicalStateId, _medicalStateSpecification);
if (m.Medicines is null)
m.Medicines = new List<Medicine>();
var d = _medicineUnitOfWork.Entity.GetById(medicineId, _medicineSpecification);
m.Medicines.Remove(d);
_medicalStateUnitOfWork.Entity.Update(m);
_medicalStateUnitOfWork.Save();
}
public void Delete(int id)
{
......
......@@ -52,7 +52,7 @@ namespace ApplicationCore.Services
_medicineUnitOfWork.Save();
return r;
}
public Medicine GetMedicineDetails(int id)
public Medicine GetDetails(int id)
{
return _medicineUnitOfWork.Entity.GetById(id, _medicineIngredientSpecification);
......
......@@ -54,7 +54,7 @@ namespace ApplicationCore.Services
_patientUnitOfWork.Entity.Update(ptient);
_patientUnitOfWork.Save();
}
public Patient GetById(int id, params Expression<Func<Patient, object>>[] includeProperties)
public Patient GetDetails(int id)
{
return _patientUnitOfWork.Entity.GetById(id, _patientMedicinesSpecification);
......@@ -67,12 +67,13 @@ namespace ApplicationCore.Services
_patientUnitOfWork.Save();
}
public void Update(Patient patient)
public Patient Update(Patient patient)
{
_patientUnitOfWork.Entity.Update(patient);
var p =_patientUnitOfWork.Entity.Update(patient);
_patientUnitOfWork.Save();
return p;
}
public void Delete(int id)
{
......
......@@ -8,20 +8,107 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
namespace WebPresentation.Controllers
{
[Authorize]
public abstract class BaseController : Controller
public abstract class BaseController<T> : Controller where T : EntityBase
{
private readonly UserManager<User> _userManager;
private readonly IUnitOfWork<Patient> _patientUnitOfWork;
public BaseController(UserManager<User> userManager) {
private readonly IService<T> _service;
public BaseController(UserManager<User> userManager , IService<T> service) {
_userManager = userManager;
_service = service;
}
public User GetCurrentUser() {
// Details
//
public IActionResult Details(int? id ) {
if (id is null)
{
return NotFound();
}
else {
T TModel = _service.GetDetails((int)id);
if (TModel is null)
return NotFound();
return View(TModel);
}
}
public IActionResult Delete(int id)
{
var TModel = _service.GetDetails(id);
if (TModel == null)
{
return NotFound();
}
return View(TModel);
}
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public IActionResult DeleteConfirmed(int id)
{
_service.Delete(id);
return RedirectToAction("Index" );
}
// GET: Projects/Edit/5
public IActionResult Edit(int? id)
{
if (id == null)
{
return NotFound();
}
T tModel = _service.GetDetails((int)id);
if (tModel == null)
{
return NotFound();
}
return View(tModel);
}
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Edit(int id, T tModel)
{
if (id != tModel.Id)
{
return NotFound();
}
if (ModelState.IsValid)
{
try
{
tModel= _service.Update(tModel);
}
catch (DbUpdateConcurrencyException)
{
return NotFound() ;
}
return RedirectToAction("Index");
}
return View(tModel);
}
#region Current User Details
public User GetCurrentUser() {
User usr = GetCurrentUserAsync().Result;
return usr;
}
......@@ -37,6 +124,7 @@ namespace WebPresentation.Controllers
public String GetUserId() {
return GetCurrentUser().Id;
}
#endregion Current User Details
}
}
......@@ -15,7 +15,7 @@ namespace WebPresentation.Controllers
{
[Authorize(Roles ="patient")]
public class HomeController : BaseController
public class HomeController : BaseController<Patient>
{
private readonly IPatientService _patientService;
private readonly IMedicineService _medicineService;
......@@ -26,7 +26,7 @@ namespace WebPresentation.Controllers
UserManager<User> userManager,
IPatientService patientService,
IMedicineService medicineService
):base(userManager)
):base(userManager,patientService)
{
_userManager = userManager;
_medicineService = medicineService;
......@@ -51,11 +51,6 @@ namespace WebPresentation.Controllers
}
public IActionResult MedicinesGalary() {
return View(_medicineService.GetAllMedicines());
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
......
......@@ -7,10 +7,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
namespace WebPresentation.Controllers
{
public class IngredientController : BaseController
[Authorize(Roles = "Admin")]
public class IngredientController : BaseController<Ingredient>
{
private readonly IIngredientService _ingredientService;
private readonly IMedicineService _medicineService;
......@@ -19,7 +21,7 @@ namespace WebPresentation.Controllers
public IngredientController(UserManager<User> userManager,
IMedicineService medicineService ,
IIngredientService ingredientSercie
) : base(userManager)
) : base(userManager,ingredientSercie)
{
_ingredientService =ingredientSercie;
......@@ -34,24 +36,7 @@ namespace WebPresentation.Controllers
}
public IActionResult Details(int? id)
{
if (id == null)
{
return NotFound();
}
var ingredient = _ingredientService.GetIngredientDetails((int)id);
if (ingredient == null)
{
return NotFound();
}
return View(ingredient);
}
// GET: Projects/Create
public IActionResult Create()
{
return View();
......@@ -72,72 +57,6 @@ namespace WebPresentation.Controllers
return View(ingredient);
}
// GET: Projects/Edit/5
public IActionResult Edit(int? id)
{
if (id == null)
{
return NotFound();
}
var ingredient = _ingredientService.GetIngredientDetails((int)id);
if (ingredient == null)
{
return NotFound();
}
return View(ingredient);
}
// POST: Projects/Edit/5
// To protect from overposting attacks, enable the specific properties you want to bind to.
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Edit(int id, Ingredient ingredient)
{
if (id != ingredient.Id)
{
return NotFound();
}
if (ModelState.IsValid)
{
try
{
_ingredientService.Update(ingredient);
}
catch (DbUpdateConcurrencyException)
{/*
if (!_medicineService.projectExists(project.Id))
{
return NotFound();
}
else
{
throw;
}
*/
}
return RedirectToAction(nameof(Index));
}
return View(ingredient);
}
// GET: Projects/Delete/5
public IActionResult Delete(int id)
{
var ingredient = _ingredientService.GetIngredientDetails(id);
if (ingredient == null)
{
return NotFound();
}
return View(ingredient);
}
public IActionResult AddIngredints(int id)
{
var s = _ingredientService.GetAllIngredients();
......@@ -148,13 +67,5 @@ namespace WebPresentation.Controllers
// POST: Projects/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public IActionResult DeleteConfirmed(int id)
{
_ingredientService.Delete(id);
return RedirectToAction(nameof(Index));
}
}
}
......@@ -11,26 +11,27 @@ using System.Threading.Tasks;
namespace WebPresentation.Controllers
{
[Authorize]
public class MedicalStateController : BaseController
[Authorize(Roles = "patient")]
public class MedicalStateController : BaseController<MedicalState>
{
private readonly IMedicalStateService _medicalStateService;
private readonly IMedicineService _medicineService;
private readonly IPatientService _patientService;
private readonly IMedicineService _medicineService;
public MedicalStateController(UserManager<User> userManager,
IMedicalStateService medicalStateService ,
IPatientService patientService ,
IMedicineService medicineService
) : base(userManager)
IMedicineService medicineService
) : base(userManager,medicalStateService)
{
_medicalStateService = medicalStateService;
_medicineService = medicineService;
_patientService =patientService;
_medicineService = medicineService;
}
public IActionResult Index(int? id )
public IActionResult Index( )
{
var u = GetUserId();
var pId = _patientService.GetAll().Where(p => p.User.Id == u).FirstOrDefault().Id;
......@@ -39,32 +40,13 @@ namespace WebPresentation.Controllers
}
public IActionResult Details(int? id)
{
if (id == null)
{
return NotFound();
}
var medicine = _medicalStateService.GetDetails((int)id);
if (medicine == null)
{
return NotFound();
}
return View(medicine);
}
// GET: Projects/Create
public IActionResult Create()
{
return View();
}
// POST: Projects/Create
// To protect from overposting attacks, enable the specific properties you want to bind to.
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Create(MedicalState medicalState, int id)
......@@ -80,99 +62,20 @@ namespace WebPresentation.Controllers
.FirstOrDefault().Id;
if (medicalState.PrescriptionTime == DateTime.MinValue )
medicalState.PrescriptionTime = DateTime.Now;
_medicalStateService.Add(p,medicalState);
return RedirectToAction("Details", "MedicalState", new { Id = id });
}
return View(medicalState);
}
// GET: Projects/Edit/5
public IActionResult Edit(int? id)
{
var uId = GetUserId();
var p = _patientService.GetAll(
)
.Where(
u => u.User.Id == uId
)
.FirstOrDefault();
ViewBag.id = p.Id;
if (id == null)
{
return NotFound();
}
var medicine = _medicalStateService.GetDetails((int)id);
if (medicine == null)
{
return NotFound();
}
return View(medicine);
}
// POST: Projects/Edit/5
// To protect from overposting attacks, enable the specific properties you want to bind to.
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Edit(int id,int pId , MedicalState medicalState)
{
if (id != medicalState.Id)
{
return NotFound();
}
if (ModelState.IsValid)
{
try
{
medicalState.PatientId = pId;
// _patientService.UpdateMedicalState(p.Id, medicalState);
_medicalStateService.Update(medicalState );
}
catch (DbUpdateConcurrencyException)
{/*
if (!_medicineService.projectExists(project.Id))
{
return NotFound();
}
else
{
throw;
}
*/
}
return RedirectToAction("Details","MedicalState",new { Id =id});
var n= _medicalStateService.Add(p,medicalState);
return RedirectToAction("Details", "MedicalState", new { Id = n.Id });
}
return View(medicalState);
}
// GET: Projects/Delete/5
public IActionResult Delete(int id)
{
var project = _medicalStateService.GetDetails(id);
if (project == null)
{
return NotFound();
}
return View(project);
}
[HttpGet]
public IActionResult AddMedicine(int id)
{
var s = _medicineService.GetAllMedicines();
var all = _medicineService.GetAllMedicines();
ViewBag.MedicalStateId = id;
return View(s);
return View(all);
}
[HttpPost]
public IActionResult AddMedicine(int id, int med)
{
......@@ -180,14 +83,12 @@ namespace WebPresentation.Controllers
return RedirectToAction("Details", "MedicalState", new { Id = id });
}
// POST: Projects/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public IActionResult DeleteConfirmed(int id)
[HttpPost]
public IActionResult RemoveMedicine(int id, int med)
{
_medicalStateService.Delete(id);
return RedirectToAction(nameof(Index));
_medicalStateService.RemoveMedicine(id, med);
return RedirectToAction("Details", "MedicalState", new { Id = id });
}
}
......
......@@ -16,7 +16,7 @@ using System.Threading.Tasks;
namespace WebPresentation.Controllers
{
[Authorize(Roles ="Admin")]
public class MedicineController : BaseController
public class MedicineController : BaseController<Medicine>
{
private readonly IIngredientService _ingredientService;
private readonly IMedicineService _medicineService;
......@@ -27,7 +27,7 @@ namespace WebPresentation.Controllers
IIngredientService ingredientService ,
IPatientService patientService
):base(userManager)
):base(userManager ,medicineService)
{
_ingredientService =ingredientService;
_medicineService = medicineService;
......@@ -46,23 +46,6 @@ namespace WebPresentation.Controllers
return View(s);
}
public IActionResult Details(int? id)
{
if (id == null)
{
return NotFound();
}
var medicine = _medicineService.GetMedicineDetails((int)id);
if (medicine == null)
{
return NotFound();
}
return View(medicine);
}
// GET: Projects/Create
public IActionResult Create()
{
......@@ -84,72 +67,7 @@ namespace WebPresentation.Controllers
return View(medicine);
}
// GET: Projects/Edit/5
public IActionResult Edit(int? id)
{
if (id == null)
{
return NotFound();
}
var medicine = _medicineService.GetMedicineDetails((int)id);
if (medicine == null)
{
return NotFound();
}
return View(medicine);
}
// POST: Projects/Edit/5
// To protect from overposting attacks, enable the specific properties you want to bind to.
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Edit(int id,Medicine medicine)
{
if (id != medicine.Id)
{
return NotFound();
}
if (ModelState.IsValid)
{
try
{
_medicineService.Update(medicine);
}
catch (DbUpdateConcurrencyException)
{/*
if (!_medicineService.projectExists(project.Id))
{
return NotFound();
}
else
{
throw;
}
*/
}
return RedirectToAction(nameof(Index));
}
return View(medicine);
}
// GET: Projects/Delete/5
public IActionResult Delete(int id)
{
var project = _medicineService.GetMedicineDetails(id);
if (project == null)
{
return NotFound();
}
return View(project);
}
public IActionResult AddIngredints(int id ) {
var s = _ingredientService.GetAllIngredients();
ViewBag.MedicineId = id;
......@@ -159,20 +77,11 @@ namespace WebPresentation.Controllers
[HttpPost]
public IActionResult AddIngredints(int id , int med ,int ratio )
{
var s = _ingredientService.GetIngredientDetails(id);
var s = _ingredientService.GetDetails(id);
_medicineService.AddIngredient(med, ratio, s);
return RedirectToAction("Details","Medicine", new { Id = med}) ;
}
// POST: Projects/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public IActionResult DeleteConfirmed(int id)
{
_medicineService.Delete(id);
return RedirectToAction(nameof(Index));
}
}
}
@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}
......@@ -231,7 +231,10 @@
<div class="divider-custom-line"></div>
</div>
<!-- Portfolio Modal - Image -->
<img class="img-fluid rounded mb-5" src="/img/portfolio/ecole.png" alt="">
<div class="icon-box">
<div class="icon " style="color: #5e54b3"><i class="fas fa-heartbeat fa-10x "></i></div>
</div>
<!-- Portfolio Modal - Text -->
<p class="mb-5">State Description : @item.StateDescription</p>
<p class="mb-5">State Name : @item.StateName</p>
......
@model MedicalState
@{
ViewData["Title"] = "Medical State Details ";
var a = 0;
}
<section class="page-section" style="background-color: #f4f5f7;">
<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;">
<div class="row g-0">
<div class="col-md-4 gradient-custom text-center text-black"
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;">
<img src="~/img/portfolio/ecole.png"
alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<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">
<i class="far fa-backward">
</i>
Go Back
</a>
</div>
<div class="col-md-10">
<div class="card-body p-4">
<h6>Information</h6>
<hr class="mt-0 mb-4">
<div class="row pt-1">
<div class="col-6 mb-3">
<h6>Description</h6>
<p class="text-muted">@Model.StateDescription</p>
</div>
<div class="col-6 mb-3">
<h6>Medicines Count:@Model.Medicines.Count()</h6>
</div>
</div>
<h6>Medicines : </h6>
<hr class="mt-0 mb-4">
<div class="row pt-1">
<table class="table table-bordered">
<thead>
<tr>
<td>#</td>
<td>Name</td>
<td>Description</td>
<td>Price</td>
<td>dosage</td>
<td>Manfacture Name</td>
</tr>
</thead>
<tbody>
@foreach (var ing in Model.Medicines)
{
<tr class=" mb-3">
<td>@(a+=1)</td>
<td>@ing.TradeName</td>
<td>@ing.Description</td>
<td>@ing.Price</td>
<td>@ing.Dosage</td>
<td>@ing.ManufactureName</td>
</tr>
}
</tbody>
</table>
</div>
<div class="row pt-1">
<div class="col-6 mb-3">
<h6>Go To list </h6>
<a asp-action="Index">Back to List</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="page-section mt-5">
<!-- Carousel wrapper -->
<div id="carouselMultiItemExample"
data-mdb-carousel-init class="carousel slide carousel-dark text-center"
data-mdb-ride="carousel">
<!-- Inner -->
<div class="carousel-inner py-4">
<!-- Single item -->
<div class="carousel-item active">
<div class="container">
<div class="row">
@foreach (var item in Model.Medicines)
{
<div class="col-lg-4">
<div class="card m-3">
<img src="/img/portfolio/@item.Image"
class="card-img-top img-fluid" style="max-height:250px "
alt="Waterfall" />
<div class="card-body">
<h5 class="card-title">@item.TradeName</h5>
<p class="card-text">
@item.Description
<br />
Price : @item.Price <br />
Type : @item.MedicineType
</p>
<a asp-action="AddMedicine" asp-controller="Home" asp-route-id="@item.Id" data-mdb-ripple-init class="btn btn-primary">Add to my Profile</a>
</div>
</div>
</div>
}
</div>
</div>
</div>
</div>
<!-- Inner -->
</div>
<!-- Carousel wrapper -->
</section>
\ No newline at end of file
@model IEnumerable<Medicine>
@(ViewData["Title"]="Medicines Galary")
<section class="page-section mt-5">
<!-- Carousel wrapper -->
<div id="carouselMultiItemExample"
data-mdb-carousel-init class="carousel slide carousel-dark text-center"
data-mdb-ride="carousel">
<!-- Inner -->
<div class="carousel-inner py-4">
<!-- Single item -->
<div class="carousel-item active">
<div class="container">
<div class="row">
@foreach(var item in Model) {
<div class="col-lg-4">
<div class="card m-3">
<img src="/img/portfolio/@item.Image"
class="card-img-top img-fluid"style="max-height:250px "
alt="Waterfall" />
<div class="card-body">
<h5 class="card-title">@item.TradeName</h5>
<p class="card-text">
@item.Description
<br />
Price : @item.Price <br />
Type : @item.MedicineType
</p>
<a asp-action="AddMedicine" asp-controller="Home" asp-route-id="@item.Id" data-mdb-ripple-init class="btn btn-primary">Add to my Profile</a>
</div>
</div>
</div>
}
</div>
</div>
</div>
</div>
<!-- Inner -->
</div>
<!-- Carousel wrapper -->
</section>
\ No newline at end of file
......@@ -17,9 +17,12 @@
</div>
</div>
</div>
</div>
</div>
<p>
<a asp-action="Create" class="btn btn-primary ">Create New</a>
</p>
<div>
<table id="datatablesSimple" class="table">
<table id="datatablesSimple" class="table">
<thead>
<tr>
<th scope="col">
......@@ -32,7 +35,7 @@
@Html.DisplayNameFor(model => model.First().Name)
</th>
<th scope="col">
@Html.DisplayNameFor(model => model.First().Description)
......@@ -49,7 +52,7 @@
<th scope="row">ID</th>
<th> name</th>
<th>Description</th>
<th>Manage</th>
</tr>
</tfoot>
......@@ -69,7 +72,7 @@
<td>
@Html.DisplayFor(modelItem => item.Description)
</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>
<a asp-action="Details" asp-controller="Ingredient" asp-route-id="@item.Id"><i class="far fa-address-card"></i></a>
......
......@@ -16,8 +16,9 @@
<div class="row g-0">
<div class="col-md-4 gradient-custom text-center text-black"
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;">
<img src="~/img/portfolio/ecole.png"
alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<div class="icon-box">
<div class="icon " style="color: #5e54b3"><i class="fas fa-heartbeat fa-8x "></i></div>
</div>
<h5>@Model.StateName</h5>
<p>AT: @(Model.PrescriptionTime )</p>
<a asp-action="Edit" asp-controller="MedicalState" asp-route-id="@Model.Id">
......
......@@ -22,8 +22,11 @@
<div class="row g-0">
<div class="col-md-4 gradient-custom text-center text-black"
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;">
<img src="~/img/portfolio/ecole.png"
alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<div class="icon-box">
<div class="icon " style="color: #5e54b3"><i class="fas fa-heartbeat fa-8x "></i></div>
</div>
<h5>@item.StateName</h5>
<p>Prescriped At : @item.PrescriptionTime</p>
<a asp-action="Edit" asp-route-id="@item.Id">
......
@model IEnumerable<Ingredient>
@{
}
<section class="page-section p-5">
<section class="page-section p-5 m-5">
<form class=" " method="post" asp-action="AddIngredints">
......@@ -11,7 +11,7 @@
<p class="help-block text-danger"></p>
</div>
<select class="form-select" asp-for="@Model.First().Id">
<select class="form-select custom-select" asp-for="@Model.First().Id">
@foreach (var i in Model)
{
<option value="@i.Id">@i.Name </option>
......
......@@ -12,7 +12,6 @@
<h4>Project</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form asp-action="Create">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
......@@ -46,7 +45,7 @@
</div>
<div class="form-group">
<div class="col-5">
<label for="Category" class="control-label"></label>
<label for="Category" class="control-label">Category</label>
<input asp-for="Category.Name" class="form-control" />
<span asp-validation-for="Category.Name" class="text-danger"></span>
......@@ -65,16 +64,15 @@
<span asp-validation-for="Image" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Image" class="control-label"></label>
<input asp-for="Image" class="form-control" />
<span asp-validation-for="Image" class="text-danger"></span>
<label asp-for="MedicineType.TypeName" class="control-label"></label>
<input asp-for="MedicineType.TypeName" class="form-control" />
<span asp-validation-for="MedicineType.TypeName" class="text-danger"></span>
</div>
<div class="form-group">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</form>
</div>
</div>
<div>
<a asp-action="Index">Back to List</a>
......
......@@ -104,12 +104,12 @@
</div>
<!-- Medical State Managment -->
<a class="nav-link collapsed" asp-action="Index" asp-controller="Medicine" data-bs-toggle="collapse" data-bs-target="#cPages" aria-expanded="false" aria-controls="collapsePages">
<a class="nav-link collapsed" asp-action="Index" asp-controller="Medicine" data-bs-toggle="collapse" data-bs-target="#MPages" aria-expanded="false" aria-controls="collapsePages">
<div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
Medical States
<div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
</a>
<div class="collapse" id="cPages" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
<div class="collapse" id="MPages" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
<nav class="sb-sidenav-menu-nested nav">
<a class="nav-link" >Add Medical State </a>
<a class="nav-link" >ALL Medical State </a>
......
......@@ -47,9 +47,6 @@
<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="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="MedicineGalary" asp-controller="Home">Galary</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>
</li>
......
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "bd7a098e0cb6bfa5309d1d17c44c54e46532ba0a"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "73fb231ac798781ebdb3a7811abecbb78ae062d4"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_AddIngredints), @"mvc.1.0.view", @"/Views/Medicine/AddIngredints.cshtml")]
......@@ -39,11 +39,11 @@ using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"bd7a098e0cb6bfa5309d1d17c44c54e46532ba0a", @"/Views/Medicine/AddIngredints.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"73fb231ac798781ebdb3a7811abecbb78ae062d4", @"/Views/Medicine/AddIngredints.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"e6fffd8dfe80957a1cbddaf47a216a7c128d6cf7", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_AddIngredints : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<Ingredient>>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form-select"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form-select custom-select"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString(" "), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("method", "post", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "AddIngredints", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
......@@ -74,10 +74,10 @@ using System;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
WriteLiteral("<section class=\"page-section p-5\">\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "bd7a098e0cb6bfa5309d1d17c44c54e46532ba0a5202", async() => {
WriteLiteral("<section class=\"page-section p-5 m-5\">\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "73fb231ac798781ebdb3a7811abecbb78ae062d45220", async() => {
WriteLiteral("\r\n\r\n\r\n <div class=\"form-group floating-label-form-group controls mb-0 pb-2\">\r\n <label>Choose Ingredient</label>\r\n\r\n <p class=\"help-block text-danger\"></p>\r\n </div>\r\n\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("select", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "bd7a098e0cb6bfa5309d1d17c44c54e46532ba0a5689", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("select", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "73fb231ac798781ebdb3a7811abecbb78ae062d45707", async() => {
WriteLiteral("\r\n");
#nullable restore
#line 15 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
......@@ -88,7 +88,7 @@ using System;
#line hidden
#nullable disable
WriteLiteral(" ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "bd7a098e0cb6bfa5309d1d17c44c54e46532ba0a6228", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "73fb231ac798781ebdb3a7811abecbb78ae062d46246", async() => {
#nullable restore
#line 17 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
Write(i.Name);
......@@ -149,10 +149,10 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For = ModelExpressionProvi
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n <br>\r\n\r\n <input class=\"form-text\" type=\"number\" name=\"ratio\" />\r\n <br>\r\n\r\n <input");
BeginWriteAttribute("value", " value=\"", 660, "\"", 687, 1);
BeginWriteAttribute("value", " value=\"", 678, "\"", 705, 1);
#nullable restore
#line 25 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
WriteAttributeValue("", 668, ViewBag.MedicineId, 668, 19, false);
WriteAttributeValue("", 686, ViewBag.MedicineId, 686, 19, false);
#line default
#line hidden
......
33f3d8c810665d6e327e2a33c591d40732ef4c81
0121606dc1c1f1a1cec55cbab12273c45a3ca7b2
......@@ -160,7 +160,6 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.dl
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\ref\WebPresentation.dll
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.pdb
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\WebPresentation.genruntimeconfig.cache
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Home\MedicinesGalary.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Medicine\AddIngredints.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Ingredient\Create.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Ingredient\Delete.cshtml.g.cs
......@@ -169,7 +168,6 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Ingred
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Ingredient\Index.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Access\Login.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Access\Register.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Home\MedicalStateDetails.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\MedicalState\Create.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\MedicalState\Details.cshtml.g.cs
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\MedicalState\Edit.cshtml.g.cs
......@@ -180,3 +178,4 @@ C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\ApplicationDomain.
C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\ApplicationDomain.pdb
C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\AutoMapper.dll
C:\Users\HASAN\Desktop\Medic\WebPresentation\bin\Debug\net5.0\AutoMapper.Extensions.Microsoft.DependencyInjection.dll
C:\Users\HASAN\Desktop\Medic\WebPresentation\obj\Debug\net5.0\Razor\Views\Home\Edit.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