Commit 5f496869 authored by hasan khaddour's avatar hasan khaddour

update f

parent 2aeaaeea
...@@ -8,17 +8,24 @@ namespace ApplicationCore.Entities ...@@ -8,17 +8,24 @@ namespace ApplicationCore.Entities
{ {
public class Medicine : EntityBase public class Medicine : EntityBase
{ {
public String Name { get; set; } public String TradeName { get; set; }
public String ScintificName { get; set; }
public String ManufactureName { get; set; }
public String SideEffect { get; set; }
public String Description { get; set; } public String Description { get; set; }
public int Price { get; set; } public int Price { get; set; }
public String Image { get; set; } public String Image { get; set; }
public int Dosage { get; set; } public int Dosage { get; set; }
public Category Category { get; set; } public Category Category { get; set; }
public MedicineType MedicineType { get; set; } public MedicineType MedicineType { get; set; }
#region Relations
public ICollection<Ingredient> Ingredients { get; set; } public ICollection<Ingredient> Ingredients { get; set; }
//public ICollection<Patient> Patients { get; set; }
public ICollection<MedicalState> MedicalStates { get; set; }
public ICollection<MedicalStateMedicine> MedicalStateMedicines { get; set; }
public ICollection<MedicineIngredient> MedicineIngredients { get; set; } public ICollection<MedicineIngredient> MedicineIngredients { get; set; }
public ICollection<Patient> Patients { get; set; } // public ICollection<PatientMedicine> PatientMedicines { get; set; }
public ICollection<PatientMedicine> PatientMedicines { get; set; }
public void AddIngredient(Ingredient ingredient , int ratio ) { public void AddIngredient(Ingredient ingredient , int ratio ) {
MedicineIngredients.Add( MedicineIngredients.Add(
...@@ -31,7 +38,7 @@ namespace ApplicationCore.Entities ...@@ -31,7 +38,7 @@ namespace ApplicationCore.Entities
} }
#endregion Relations
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Entities
{
public class MedicalState : EntityBase
{
public int PatientId { get; set; }
public Patient Patient { get; set; }
public String StateName { get; set; }
public String StateDescription { get; set; }
public DateTime PrescriptionTime { get; set; }
public ICollection<Medicine> Medicines { get; set; }
public ICollection<MedicalStateMedicine> MedicalStateMedicines { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Entities
{
public class MedicalStateMedicine : EntityBase
{
public int MedicineId { get; set; }
public int MedicalStateId { get; set; }
#region Navigation
public Medicine Medicine { get; set; }
public MedicalState MedicalState { get; set; }
#endregion Navigation
}
}
...@@ -13,8 +13,11 @@ namespace ApplicationCore.Entities ...@@ -13,8 +13,11 @@ namespace ApplicationCore.Entities
public String UserId { get; set; } public String UserId { get; set; }
public User User { get; set; } public User User { get; set; }
public String BIO { get; set; } public String BIO { get; set; }
public ICollection<Medicine> Medicines { get; set; }
public ICollection<PatientMedicine> PatientMedicines { get; set; } #region Relations
public ICollection<MedicalState> MedicalStates { get; set; }
// public ICollection<Medicine> Medicines { get; set; }
// public ICollection<PatientMedicine> PatientMedicines { get; set; }
#endregion Relations
} }
} }
...@@ -11,13 +11,13 @@ namespace ApplicationCore.Interfaces.IServices ...@@ -11,13 +11,13 @@ namespace ApplicationCore.Interfaces.IServices
public interface IPatientService public interface IPatientService
{ {
public IEnumerable<Medicine> GetPatientMedicines(int patientId); public IEnumerable<MedicalState> GetPatientMedicalStates(int patientId);
public Medicine GetMedicineDetails(int id, params Expression<Func<Medicine, object>>[] includeProperties); public MedicalState GetMedicalStateDetails(int id, params Expression<Func<MedicalState, object>>[] includeProperties);
public IEnumerable<Patient> GetAll(params Expression<Func<Patient, object>>[] includeProperties); public IEnumerable<Patient> GetAll(params Expression<Func<Patient, object>>[] includeProperties);
public void AddMedicine(int patientId, Medicine medicine); public void AddMedicalState(int patientId, MedicalState medicalState);
public Patient GetById(int id, params Expression<Func<Patient, object>>[] includeProperties); public Patient GetById(int id, params Expression<Func<Patient, object>>[] includeProperties);
public void Insert(Patient owner); public void Insert(Patient patient);
public void Update(Patient owner); public void Update(Patient patient);
public void Delete(int id); public void Delete(int id);
public bool PatientExists(int id); public bool PatientExists(int id);
......
...@@ -14,52 +14,50 @@ namespace ApplicationCore.Services.PatientService ...@@ -14,52 +14,50 @@ namespace ApplicationCore.Services.PatientService
public class PatientService : IPatientService public class PatientService : IPatientService
{ {
private readonly IUnitOfWork<Patient> _patientUnitOfWork; private readonly IUnitOfWork<Patient> _patientUnitOfWork;
private readonly IUnitOfWork<Medicine> _medicineUnitOfWork; private readonly IUnitOfWork<MedicalState> _medicalStateUnitOfWork;
private PatientMedicinesSpecification _patientMedicinesSpecification; private PatientMedicinesSpecification _patientMedicinesSpecification;
private MedicineIngredientSpecification _medicineIngredientSpecification; private MedicalStateSpecification _medicalStateSpecification;
public PatientService(IUnitOfWork<Patient> patientUnitOfWork, IUnitOfWork<Medicine> medicineUnitOfWork) public PatientService(
IUnitOfWork<Patient> patientUnitOfWork,
IUnitOfWork<MedicalState> medicalStateUnitOfWork)
{ {
_patientUnitOfWork = patientUnitOfWork; _patientUnitOfWork = patientUnitOfWork;
_medicineUnitOfWork = medicineUnitOfWork; _medicalStateUnitOfWork = medicalStateUnitOfWork;
_patientMedicinesSpecification = new PatientMedicinesSpecification(); _patientMedicinesSpecification = new PatientMedicinesSpecification();
_medicineIngredientSpecification = new MedicineIngredientSpecification(); _medicalStateSpecification = new MedicalStateSpecification();
} }
public IEnumerable<Medicine> GetPatientMedicines(int patientId) { public IEnumerable<MedicalState> GetPatientMedicalStates(int patientId) {
return _patientUnitOfWork.Entity return _patientUnitOfWork.Entity
.GetById( .GetById(
patientId,_patientMedicinesSpecification patientId,_patientMedicinesSpecification
).Medicines.AsEnumerable(); ).MedicalStates.AsEnumerable();
} }
public Medicine GetMedicineDetails(int id, params Expression<Func<Medicine, object>>[] includeProperties) public MedicalState GetMedicalStateDetails(int id, params Expression<Func<MedicalState, object>>[] includeProperties)
{ {
return _medicineUnitOfWork.Entity.GetById(id,_medicineIngredientSpecification); return _medicalStateUnitOfWork.Entity.GetById(id,_medicalStateSpecification);
} }
public IEnumerable<Patient> GetAll(params Expression<Func<Patient, object>>[] includeProperties) { public IEnumerable<Patient> GetAll(params Expression<Func<Patient, object>>[] includeProperties) {
return _patientUnitOfWork.Entity.GetAll(_patientMedicinesSpecification); return _patientUnitOfWork.Entity.GetAll(_patientMedicinesSpecification);
} }
public void AddMedicine(int patientId, Medicine medicine) { public void AddMedicalState (int patientId, MedicalState medicalState) {
var ptient = _patientUnitOfWork.Entity.GetById(patientId,_patientMedicinesSpecification); var ptient = _patientUnitOfWork.Entity.GetById(patientId,_patientMedicinesSpecification);
if (medicine.Id != 0) if (medicalState.Id != 0)
foreach (var i in ptient.Medicines) foreach (var i in ptient.MedicalStates)
{ {
if (i.Id.Equals(medicine.Id)) if (i.Id.Equals(medicalState.Id))
return; return;
} }
ptient.PatientMedicines ptient.MedicalStates
.Add(new PatientMedicine{ .Add(medicalState
Medicine = medicine, );
Patient =ptient ,
PrescripDate=DateTime.Now
});
_patientUnitOfWork.Entity.Update(ptient); _patientUnitOfWork.Entity.Update(ptient);
_patientUnitOfWork.Save(); _patientUnitOfWork.Save();
} }
...@@ -68,19 +66,19 @@ namespace ApplicationCore.Services.PatientService ...@@ -68,19 +66,19 @@ namespace ApplicationCore.Services.PatientService
return _patientUnitOfWork.Entity.GetById(id, _patientMedicinesSpecification); return _patientUnitOfWork.Entity.GetById(id, _patientMedicinesSpecification);
} }
public void Insert(Patient owner) public void Insert(Patient patient)
{ {
_patientUnitOfWork.Entity.Insert(owner); _patientUnitOfWork.Entity.Insert(patient);
_patientUnitOfWork.Save(); _patientUnitOfWork.Save();
} }
public void Update(Patient owner) public void Update(Patient patient)
{ {
_patientUnitOfWork.Entity.Update(owner); _patientUnitOfWork.Entity.Update(patient);
_patientUnitOfWork.Save(); _patientUnitOfWork.Save();
} }
public void Delete(int id) public void Delete(int id)
......
using ApplicationCore.Entities;
using ApplicationCore.Specification.BaseSpecification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Specification
{
class MedicalStateSpecification : BaseSpecification<MedicalState>
{
public MedicalStateSpecification()
{
AddInclude(p => p.MedicalStateMedicines);
AddInclude(p => p.Medicines);
AddInclude(p => p.Patient);
AddThenInclude("MedicalStateMedicines.Medicine");
}
}
{
}
}
...@@ -17,7 +17,7 @@ namespace ApplicationCore.Specification ...@@ -17,7 +17,7 @@ namespace ApplicationCore.Specification
AddInclude(p => p.MedicineIngredients); AddInclude(p => p.MedicineIngredients);
AddInclude(p => p.Category); AddInclude(p => p.Category);
AddInclude(p => p.MedicineType); AddInclude(p => p.MedicineType);
AddInclude(p => p.Patients); AddInclude(p => p.MedicalStates);
AddInclude(p => p.Ingredients); AddInclude(p => p.Ingredients);
AddThenInclude("MedicineIngredients.Ingredient"); AddThenInclude("MedicineIngredients.Ingredient");
......
...@@ -12,9 +12,10 @@ namespace ApplicationCore.Specification ...@@ -12,9 +12,10 @@ namespace ApplicationCore.Specification
{ {
public PatientMedicinesSpecification() public PatientMedicinesSpecification()
{ {
AddInclude(p => p.Medicines); AddInclude(p => p.MedicalStates);
AddInclude(p => p.User); AddInclude(p => p.User);
AddInclude(p=> p.PatientMedicines);
AddThenInclude("MedicalStates.Medicines");
} }
......
...@@ -23,6 +23,7 @@ namespace Infrastructure.Data ...@@ -23,6 +23,7 @@ namespace Infrastructure.Data
public DbSet<Ingredient> Ingredients { get; set; } public DbSet<Ingredient> Ingredients { get; set; }
public DbSet<Category> Categories { get; set; } public DbSet<Category> Categories { get; set; }
public DbSet<MedicineType> MedicineTypes { get; set; } public DbSet<MedicineType> MedicineTypes { get; set; }
public DbSet<MedicalState> MedicalStates { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{ {
...@@ -49,17 +50,22 @@ namespace Infrastructure.Data ...@@ -49,17 +50,22 @@ namespace Infrastructure.Data
); );
modelBuilder.Entity<Patient>() modelBuilder.Entity<Patient>()
.HasMany(e => e.MedicalStates)
.WithOne(e => e.Patient);
modelBuilder.Entity<MedicalState>()
.HasMany(e => e.Medicines) .HasMany(e => e.Medicines)
.WithMany(e => e.Patients) .WithMany(e => e.MedicalStates)
.UsingEntity<PatientMedicine>( .UsingEntity<MedicalStateMedicine>(
l => l.HasOne<Medicine>(e => e.Medicine) l => l.HasOne<Medicine>(e => e.Medicine)
.WithMany(e => e.PatientMedicines) .WithMany(e => e.MedicalStateMedicines)
.HasForeignKey(e => e.MedicineId), .HasForeignKey(e => e.MedicineId),
r => r.HasOne<Patient>(e => e.Patient) r => r.HasOne<MedicalState>(e => e.MedicalState)
.WithMany(e => e.PatientMedicines) .WithMany(e => e.MedicalStateMedicines)
.HasForeignKey(e => e.PatientId) .HasForeignKey(e => e.MedicalStateId)
); );
modelBuilder.Entity<Patient>() modelBuilder.Entity<Patient>()
.HasOne(o => o.User); .HasOne(o => o.User);
...@@ -109,7 +115,7 @@ namespace Infrastructure.Data ...@@ -109,7 +115,7 @@ namespace Infrastructure.Data
); );
#endregion Roles #endregion Roles
#region User #region User
PasswordHasher<User> ph = new PasswordHasher<User>(); var ph = new PasswordHasher<IdentityUser>();
var admin = new User var admin = new User
{ {
...@@ -119,7 +125,8 @@ namespace Infrastructure.Data ...@@ -119,7 +125,8 @@ namespace Infrastructure.Data
Avatar = "avatar.jpg", Avatar = "avatar.jpg",
Email = "hasan@b", Email = "hasan@b",
UserName="Hasan.Bahjat", UserName="Hasan.Bahjat",
NormalizedEmail="hasan@b", PasswordHash = ph.HashPassword(null, "123@Aa"),
NormalizedEmail ="hasan@b",
NormalizedUserName= "Hasan.Bahjat", NormalizedUserName= "Hasan.Bahjat",
CreationTime = DateTime.Now CreationTime = DateTime.Now
...@@ -131,16 +138,14 @@ namespace Infrastructure.Data ...@@ -131,16 +138,14 @@ namespace Infrastructure.Data
LastName = "Khaddour", LastName = "Khaddour",
Avatar = "avatar1.jpg", Avatar = "avatar1.jpg",
Email = "hasan.bahjat@mail.y", Email = "hasan.bahjat@mail.y",
PasswordHash= ph.HashPassword(null, "123@Aa"),
UserName = "Hasan.Khaddour", UserName = "Hasan.Khaddour",
NormalizedEmail = "hasan@b", NormalizedEmail = "hasan@b",
NormalizedUserName = "Hasan.khaddour", NormalizedUserName = "Hasan.khaddour",
CreationTime = DateTime.Now CreationTime = DateTime.Now
}; };
admin.PasswordHash = ph.HashPassword(admin, "123@Aa");
PatientAccount.PasswordHash = ph.HashPassword(PatientAccount, "123@Aa");
modelBuilder.Entity<User>() modelBuilder.Entity<User>()
.HasData( .HasData(
admin, admin,
...@@ -161,24 +166,52 @@ namespace Infrastructure.Data ...@@ -161,24 +166,52 @@ namespace Infrastructure.Data
); );
#endregion Patients #endregion Patients
#region Categories
var c1 = new Category { Id = 1, Name = "Antibiotic" };
var c2 = new Category { Id = 2, Name = "Painkiller" };
modelBuilder.Entity<Category>().HasData(
c1 ,c2
);
#endregion Categories
#region MedicineType
modelBuilder.Entity<MedicineType>().HasData(
new MedicineType { Id = 1, TypeName = "Tablet" },
new MedicineType { Id = 2, TypeName = "Syrup" }
);
#endregion MedicineType
#region Ingredients
modelBuilder.Entity<Ingredient>().HasData(
new Ingredient { Id = 1, Name = "Amoxicillin" },
new Ingredient { Id = 2, Name = "Paracetamol" }
);
modelBuilder.Entity<MedicineIngredient>().HasData(
new MedicineIngredient { MedicineId = 1, IngredientId = 1 },
new MedicineIngredient { MedicineId = 2, IngredientId = 2 }
);
#endregion Ingredients
#region Medicines #region Medicines
var med = new Medicine var med = new Medicine
{ {
Id=-1, Id=1,
Name = "Augmentine", ScintificName = "Augmentine",
TradeName="Augmentine",
ManufactureName="Ibin Sina",
SideEffect="No. ",
Category=c1 ,
Image="med1.png", Image="med1.png",
Dosage = 12, Dosage = 12,
Price = 2500, Price = 2500,
}; };
var c = new Category { Id = 1, Name = "Augmentine" };
modelBuilder.Entity<Category>().HasData(c);
// med.Category = c;
modelBuilder.Entity<Medicine>().HasData(med); modelBuilder.Entity<Medicine>().HasData(med);
#endregion Medicines #endregion Medicines
#region MedicalState
#endregion MedicalState
} }
} }
} }
...@@ -21,14 +21,19 @@ namespace WebPresentation.Controllers ...@@ -21,14 +21,19 @@ namespace WebPresentation.Controllers
{ {
private readonly PatientService _patientService; private readonly PatientService _patientService;
private readonly MedicineService _medicineService; private readonly MedicineService _medicineService;
private readonly UserManager<User> _userManager; private readonly UserManager<User> _userManager;
public HomeController(UserManager<User> userManager,IUnitOfWork<Patient> patientUnitOfWork, IUnitOfWork<Medicine> medicineUnitOfWork):base(userManager) public HomeController(
UserManager<User> userManager,
IUnitOfWork<Patient> patientUnitOfWork,
IUnitOfWork<Medicine> medicineUnitOfWork,
IUnitOfWork<MedicalState> medicalStateUnitOfWork
):base(userManager)
{ {
_userManager = userManager; _userManager = userManager;
_patientService = new PatientService(patientUnitOfWork,medicineUnitOfWork);
_medicineService = new MedicineService(medicineUnitOfWork); _medicineService = new MedicineService(medicineUnitOfWork);
_patientService = new PatientService(patientUnitOfWork,medicalStateUnitOfWork);
} }
...@@ -39,9 +44,7 @@ namespace WebPresentation.Controllers ...@@ -39,9 +44,7 @@ namespace WebPresentation.Controllers
var ownesr = _patientService var ownesr = _patientService
.GetAll( .GetAll(
u => u.User , )
u => u.Medicines
)
.Where( .Where(
u => u.User.Id == userId u => u.User.Id == userId
) )
...@@ -50,13 +53,9 @@ namespace WebPresentation.Controllers ...@@ -50,13 +53,9 @@ namespace WebPresentation.Controllers
return View(ownesr); return View(ownesr);
} }
public IActionResult MedicineDetails(int id ) { public IActionResult MedicalStateDetails(int id ) {
var s = _patientService.GetMedicineDetails( var s = _patientService.GetMedicalStateDetails(
id, id);
i => i.MedicineIngredients,
i => i.Ingredients ,
i => i.Category,
i => i.MedicineType);
if (s is null) { if (s is null) {
return NotFound(); return NotFound();
} }
...@@ -68,13 +67,13 @@ namespace WebPresentation.Controllers ...@@ -68,13 +67,13 @@ namespace WebPresentation.Controllers
return View(); return View();
} }
public IActionResult AddMedicine(int id) { public IActionResult AddMedicalState(int id) {
var userId = _userManager.GetUserId(User); var userId = _userManager.GetUserId(User);
var patient = _patientService.GetAll(u => u.User, u => u.Medicines) var patient = _patientService.GetAll()
.Where(u => u.User.Id ==userId ).FirstOrDefault(); .Where(u => u.User.Id ==userId ).FirstOrDefault();
var m =_medicineService.GetMedicineDetails(id); var m =_patientService.GetMedicalStateDetails(id);
_patientService.AddMedicine(patient.Id, m); _patientService.AddMedicalState(patient.Id, m);
return RedirectToAction("Index","Home"); return RedirectToAction("Index","Home");
......
...@@ -26,11 +26,12 @@ namespace WebPresentation.Controllers ...@@ -26,11 +26,12 @@ namespace WebPresentation.Controllers
public MedicineController(UserManager<User> userManager, public MedicineController(UserManager<User> userManager,
IUnitOfWork<Patient> patientUnitOfWork, IUnitOfWork<Patient> patientUnitOfWork,
IUnitOfWork<Medicine> medicineUnitOfWork, IUnitOfWork<Medicine> medicineUnitOfWork,
IUnitOfWork<MedicalState> medicalStateUnitOfWork,
IUnitOfWork<Ingredient>ingredientUnitOfWork):base(userManager) IUnitOfWork<Ingredient>ingredientUnitOfWork):base(userManager)
{ {
_ingredientService =new IngredientService( ingredientUnitOfWork); _ingredientService =new IngredientService( ingredientUnitOfWork);
_medicineService = new MedicineService( medicineUnitOfWork); _medicineService = new MedicineService( medicineUnitOfWork);
_patientService = new PatientService(patientUnitOfWork,medicineUnitOfWork); _patientService = new PatientService(patientUnitOfWork,medicalStateUnitOfWork);
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName; ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName;
ViewBag.owner = Model; ViewBag.owner = Model;
var top = Model.Medicines.Where(t => t.Dosage > 0).ToList();
var i = 1; var i = 1;
} }
...@@ -64,29 +63,29 @@ ...@@ -64,29 +63,29 @@
<!-- Portfolio Grid Items --> <!-- Portfolio Grid Items -->
<div class="row d-flex flex-wrap justify-content-sm-center"> <div class="row d-flex flex-wrap justify-content-sm-center">
@if (Model.Medicines.Count() == 0) @if (Model.MedicalStates.Count() == 0)
{ {
<h2 class="text-center">You dont have any Medicine</h2> <h2 class="text-center">You dont have any MedicalState</h2>
<img src="~/img/portfolio/noData.jpg" class="figure-img" /> <img src="~/img/portfolio/noData.jpg" class="figure-img" />
} }
else else
@foreach (var item in Model.Medicines) @foreach (var item in Model.MedicalStates)
{ {
<div class="col-lg-4"> <div class="col-lg-4">
<div class="card m-3"> <div class="card m-3">
<img src="/img/portfolio/@item.Image" <img src="/img/portfolio/flappy.png"
class="card-img-top img-fluid" style="max-height:250px " class="card-img-top img-fluid" style="max-height:250px "
alt="Waterfall" /> alt="Waterfall" />
<div class="card-body"> <div class="card-body">
<h5 class="card-title">@item.Name</h5> <h5 class="card-title">@item.StateName</h5>
<p class="card-text"> <p class="card-text">
@item.Description @item.StateDescription
<br /> <br />
Price : @item.Price <br /> Date : @item.PrescriptionTime <br />
Type : @item.MedicineType Medicines : @item.Medicines.Count()
</p> </p>
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#item-@(item.Id)">go to descriptiuon </a> <a href="#" class="btn btn-primary" data-toggle="modal" data-target="#item-@(item.Id)">go to descriptiuon </a>
...@@ -171,7 +170,7 @@ ...@@ -171,7 +170,7 @@
</section> </section>
<!-- Modals --> <!-- Modals -->
@foreach (var item in Model.Medicines) @foreach (var item in Model.MedicalStates)
{ {
<!-- Portfolio Modal --> <!-- Portfolio Modal -->
<div class="portfolio-modal modal fade" id="item-@(item.Id)" tabindex="-1" role="dialog" aria-labelledby="label-@item.Id" aria-hidden="true"> <div class="portfolio-modal modal fade" id="item-@(item.Id)" tabindex="-1" role="dialog" aria-labelledby="label-@item.Id" aria-hidden="true">
...@@ -188,7 +187,7 @@ ...@@ -188,7 +187,7 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-lg-8"> <div class="col-lg-8">
<!-- Portfolio Modal - Title --> <!-- Portfolio Modal - Title -->
<h2 class="portfolio-modal-title text-secondary text-uppercase mb-0">@item.Name </h2> <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0">@item.StateName </h2>
<!-- Icon Divider --> <!-- Icon Divider -->
<div class="divider-custom"> <div class="divider-custom">
<div class="divider-custom-line"></div> <div class="divider-custom-line"></div>
...@@ -198,13 +197,13 @@ ...@@ -198,13 +197,13 @@
<div class="divider-custom-line"></div> <div class="divider-custom-line"></div>
</div> </div>
<!-- Portfolio Modal - Image --> <!-- Portfolio Modal - Image -->
<img class="img-fluid rounded mb-5" src=@("/img/portfolio/"+item.Image ) ) alt=""> <img class="img-fluid rounded mb-5" src="/img/portfolio/ecole.png" alt="">
<!-- Portfolio Modal - Text --> <!-- Portfolio Modal - Text -->
<p class="mb-5">medicine Description : @item.Description</p> <p class="mb-5">State Description : @item.StateDescription</p>
<p class="mb-5">medicine price : @item.Price</p> <p class="mb-5">State Name : @item.StateName</p>
<p class="mb-5">medicine Dosage : @item.Dosage</p> <p class="mb-5">State Time : @item.PrescriptionTime</p>
<a asp-action="MedicineDetails" role="button" class="btn btn-primary" asp-controller="Home" asp-route-id="@item.Id">View More </a> <a asp-action="MedicalStateDetails" role="button" class="btn btn-primary" asp-controller="Home" asp-route-id="@item.Id">View More </a>
<button class="btn btn-primary" href="#" data-dismiss="modal"> <button class="btn btn-primary" href="#" data-dismiss="modal">
<i class="fas fa-times fa-fw"></i> <i class="fas fa-times fa-fw"></i>
Close Window Close Window
......
@model Medicine @model MedicalState
@{ @{
ViewData["Title"] = "Medicine Details "; ViewData["Title"] = "Medical State Details ";
var a = 0; var a = 0;
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<div class="row g-0"> <div class="row g-0">
<div class="col-md-4 gradient-custom text-center text-black" <div class="col-md-4 gradient-custom text-center text-black"
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;"> style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;">
<img src="~/img/portfolio/@Model.Image" <img src="~/img/portfolio/ecole.png"
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.</h5>
<p>For: @(Model.Category is null ? "":Model.Category.Name)</p> <p>For: @(Model.Category is null ? "":Model.Category.Name)</p>
<a asp-action="Edit" asp-route-id="@Model.Id"> <a asp-action="Edit" asp-route-id="@Model.Id">
<i class="far fa-edit mb-5"></i> <i class="far fa-edit mb-5"></i>
......
...@@ -16,9 +16,16 @@ ...@@ -16,9 +16,16 @@
<form asp-action="Create"> <form asp-action="Create">
<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">
<label asp-for="Name" class="control-label"></label> <div class="col-5">
<input asp-for="Name" class="form-control" /> <label asp-for="TradeName" class="control-label"></label>
<span asp-validation-for="Name" class="text-danger"></span> <input asp-for="TradeName" class="form-control" />
<span asp-validation-for="TradeName" class="text-danger"></span>
</div>
<div class="col-5">
<label asp-for="ScintificName" class="control-label"></label>
<input asp-for="ScintificName" class="form-control" />
<span asp-validation-for="ScintificName" class="text-danger"></span>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="Description" class="control-label"></label> <label asp-for="Description" class="control-label"></label>
......
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