Commit e0d8a6d1 authored by hasan khaddour's avatar hasan khaddour

fix mapping

parent ee396f8e
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
{
public class DomainBase : EntityBase
{
// public int Id { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
{
public class CategoryModel : DomainBase
{
public String Name { get; set; }
// public ICollection<MedicineModel> Medicines { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
{
public class IngredientModel : DomainBase
{
public String Name { get; set; }
public String Description { get; set; }
// public ICollection<MedicineModel> Medicines { get; set; }
// public ICollection<MedicineIngredientModel> MedicineIngredients { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
{
public class MedicineIngredientModel : DomainBase
{
public int Ratio { get; set; }
public int MedicineId { get; set; }
public int IngredientId { get; set; }
// public MedicineModel Medicine { get; set; }
public IngredientModel Ingredient { get; set; }
}
}
......@@ -5,9 +5,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.ViewModel
namespace ApplicationCore.DomainModel
{
public class MedicineViewModel
public class MedicineModel : DomainBase
{
public String TradeName { get; set; }
......@@ -18,10 +18,12 @@ namespace ApplicationCore.ViewModel
public int Price { get; set; }
public String Image { get; set; }
public int Dosage { get; set; }
public Category Category { get; set; }
public MedicineType MedicineType { get; set; }
public ICollection<Ingredient> Ingredients { get; set; }
public ICollection<MedicalState> MedicalStates { get; set; }
public CategoryModel Category { get; set; }
public MedicineTypeModel MedicineType { get; set; }
public ICollection<IngredientModel> Ingredients { get; set; }
// public ICollection<MedicalStateModel> MedicalStates { get; set; }
// public ICollection<MedicalStateMedicineModel> MedicalStateMedicines { get; set; }
public ICollection<MedicineIngredientModel> MedicineIngredients { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
{
public class MedicineTypeModel : DomainBase
{
public String TypeName { get; set; }
// public ICollection<MedicineModel> Medicines { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
{
public class MedicalStateMedicineModel : DomainBase
{
public int MedicineId { get; set; }
public int MedicalStateId { get; set; }
#region Navigation
// public MedicineModel Medicine { get; set; }
// public MedicalStateModel MedicalState { get; set; }
#endregion Navigation
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
{
public class MedicalStateModel : DomainBase
{
public int PatientId { get; set; }
public PatientModel Patient { get; set; }
public String StateName { get; set; }
public String StateDescription { get; set; }
public DateTime PrescriptionTime { get; set; }
public ICollection<MedicineModel> Medicines { get; set; }
// public ICollection<MedicalStateMedicineModel> MedicalStateMedicines { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationDomain.Entities
{
public class PatientMedicine : EntityBase
{
public DateTime PrescripDate { get; set; }
public int MedicineId { get; set; }
public int PatientId { get; set; }
public Medicine Medicine { get; set; }
public Patient Patient { get; set; }
}
}
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
{
public class PatientModel : DomainBase
{
public String UserId { get; set; }
public User User { get; set; }
public String BIO { get; set; }
#region Relations
public ICollection<MedicalStateModel> MedicalStates { get; set; }
// public ICollection<Medicine> Medicines { get; set; }
// public ICollection<PatientMedicine> PatientMedicines { get; set; }
#endregion Relations
}
}
......@@ -8,9 +8,10 @@ namespace ApplicationCore.Interfaces
{
public interface IService<T> where T : class
{
public T GetDetails(int Id);
public Task<T> GetDetails(int Id);
public void Delete(int Id);
public T Update(T tModel);
public T Create(T tModel);
......
using ApplicationDomain.Entities;
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -7,14 +8,9 @@ using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IIngredientService : IService<Ingredient>
public interface IIngredientService : IService<IngredientModel>
{
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 Task<IEnumerable<IngredientModel>> GetAllIngredients();
public void AddToMedicine(int ingredientId ,int medicineId , int ratio);
}
}
using ApplicationDomain.Entities;
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -7,12 +8,12 @@ using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IMedicalStateService : IService<MedicalState>
public interface IMedicalStateService : IService<MedicalStateModel>
{
public IEnumerable<MedicalState> GetAll();
public Task<IEnumerable<MedicalStateModel>> GetAll();
public IEnumerable<MedicalState> GetAllPatientMedicalStates(int patientId);
public MedicalState Add(int patientId , MedicalState medicalState);
public IEnumerable<MedicalStateModel> GetAllPatientMedicalStates(int patientId);
public MedicalStateModel Add(int patientId , MedicalStateModel medicalState);
public void AddMedicine(int medicalStateId, int medicineId);
public void RemoveMedicine(int medicalStateId, int medicineId);
......
using ApplicationDomain.Entities;
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -7,16 +8,13 @@ using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IMedicineService :IService<Medicine>
public interface IMedicineService :IService<MedicineModel>
{
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 GetMedicineIngredentisDetails(int medicineId);
public void AddIngredient(int medicineId, int ratio, Ingredient ingredient);
// public void Delete(int id);
public Task<IEnumerable<MedicineModel>> GetAllMedicines();
// public void AddMedicine(MedicineModel medicine);
public void AddMedicineIngredient(int medicineId, IngredientModel ingredient);
public MedicineModel GetMedicineIngredentisDetails(int medicineId);
public void AddIngredient( int medicineId, int ratio, IngredientModel ingredient);
}
}
using ApplicationDomain.Entities;
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -8,15 +9,15 @@ using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IPatientService :IService<Patient>
public interface IPatientService :IService<PatientModel>
{
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 IEnumerable<MedicalStateModel> GetPatientMedicalStates(int patientId);
public Task<MedicalStateModel> GetMedicalStateDetails(int id);
public Task<IEnumerable<PatientModel>>GetAll();
public void AddMedicalState(int patientId, MedicalStateModel medicalState);
// public Patient GetDetails(int id);
public void Insert(Patient patient);
public void Insert(PatientModel patient);
// public void Update(Patient patient);
// public void Delete(int id);
public bool PatientExists(int id);
......
using ApplicationCore.ViewModel;
using ApplicationDomain.Entities;
using AutoMapper;
namespace ApplicationCore.Mapper
{
public class MedicineMapper :Profile
{
public MedicineMapper() {
CreateMap<Medicine, MedicineViewModel>(
);
}
}
}
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using AutoMapper;
namespace ApplicationCore.Mapper
{
public class ObjectMapper :Profile
{
public ObjectMapper() {
CreateMap<Medicine, MedicineModel>()
.ForMember(dest => dest.Category, opt => opt.MapFrom(src => src.Category))
.ForMember(dest => dest.MedicineType, opt => opt.MapFrom(src => src.MedicineType))
.ForMember(dest => dest.Ingredients, opt => opt.MapFrom(src => src.Ingredients))
.ForMember(dest => dest.MedicineIngredients, opt => opt.MapFrom(src => src.MedicineIngredients));
;
CreateMap<MedicineModel, Medicine>()
.ForMember(de => de.Ingredients, o => o.MapFrom(s => s.Ingredients))
.ForMember(de => de.MedicineIngredients, o => o.MapFrom(s => s.MedicineIngredients))
.ForMember(de => de.MedicineType, o => o.MapFrom(s => s.MedicineType))
.ForMember(de => de.Category, o => o.MapFrom(s => s.Category))
.ForMember(dest => dest.MedicalStates, opt => opt.Ignore())
.ForMember(dest => dest.MedicalStateMedicines, opt => opt.Ignore())
;
CreateMap<PatientModel, Patient>().ReverseMap();
CreateMap<Patient, PatientModel>().ReverseMap();
CreateMap<Ingredient, IngredientModel>().ReverseMap();
CreateMap<MedicalState, MedicalStateModel>().ReverseMap();
CreateMap<Category, CategoryModel>();
CreateMap<CategoryModel, Category>()
.ForMember(dest => dest.Medicines, opt => opt.Ignore())
;
CreateMap<MedicineType, MedicineTypeModel>().ReverseMap();
CreateMap<MedicalStateMedicine, MedicalStateMedicineModel>().ReverseMap();
}
}
}
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces;
using ApplicationCore.Interfaces.IServices;
using ApplicationCore.Specification;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ApplicationCore.DomainModel;
using AutoMapper;
namespace ApplicationCore.Services
{
public class IngredientService :IIngredientService
{
private readonly IMapper _mapper;
private readonly IUnitOfWork<Ingredient> _ingredientUnitOfWork;
private IngredientSpecification _IngredientSpecification;
public IngredientService(IUnitOfWork<Ingredient> ingredientUnitOfWork)
public IngredientService(
IUnitOfWork<Ingredient> ingredientUnitOfWork,
IUnitOfWork<Medicine> medicineUnitOfWork,
IMapper mapper
)
{
_mapper = mapper;
_ingredientUnitOfWork = ingredientUnitOfWork;
_IngredientSpecification = new IngredientSpecification();
}
public IEnumerable<Ingredient> GetAllIngredients()
public async Task<IEnumerable<IngredientModel>> GetAllIngredients()
{
return _ingredientUnitOfWork.Entity.GetAll(
return _mapper.Map<IEnumerable<IngredientModel>>(await _ingredientUnitOfWork.Entity.GetAll(
_IngredientSpecification
);
));
}
public void AddIngredient(Ingredient ingredient)
public IngredientModel Create(IngredientModel ingredient)
{
_ingredientUnitOfWork.Entity.Insert(ingredient);
var ing = _ingredientUnitOfWork.Entity.Insert(_mapper.Map<Ingredient>(ingredient));
_ingredientUnitOfWork.Save();
return _mapper.Map<IngredientModel>(ing);
}
public Ingredient Update(Ingredient ingredient)
public IngredientModel Update(IngredientModel ingredient)
{
var r = _ingredientUnitOfWork.Entity.Update(ingredient);
var r = _ingredientUnitOfWork.Entity.Update(_mapper.Map<Ingredient>(ingredient));
_ingredientUnitOfWork.Save();
return r;
return _mapper.Map<IngredientModel>(r);
}
public Ingredient GetDetails(int id)
public void AddToMedicine(int ingredientId, int medicineId, int ratio) {
var r = _ingredientUnitOfWork.Entity.GetById(ingredientId,_IngredientSpecification).Result;
r.MedicineIngredients.Add(
new MedicineIngredient { IngredientId = ingredientId , MedicineId=medicineId ,Ratio=ratio}
);
_ingredientUnitOfWork.Entity.Update(r);
_ingredientUnitOfWork.Save();
}
public async Task<IngredientModel> GetDetails(int id)
{
return _ingredientUnitOfWork.Entity.GetById(id,
_IngredientSpecification);
return _mapper.Map<IngredientModel>(await _ingredientUnitOfWork.Entity.GetById(id,
_IngredientSpecification));
}
public void Delete(int id)
{
_ingredientUnitOfWork.Entity.Delete(id);
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces;
using ApplicationCore.Interfaces.IServices;
using ApplicationCore.Specification;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification;
using AutoMapper;
using ApplicationCore.DomainModel;
using System.Threading.Tasks;
namespace ApplicationCore.Services
{
public class MedicalStateService : IMedicalStateService
{
private readonly IUnitOfWork<MedicalState> _medicalStateUnitOfWork;
private readonly IUnitOfWork<MedicalState> _MedicalStateUnitOfWork;
private readonly PatientService _patientService;
private readonly IUnitOfWork<Medicine> _medicineUnitOfWork;
private readonly MedicalStateSpecification _medicalStateSpecification;
private readonly MedicalStateSpecification _MedicalStateSpecification;
private readonly MedicineIngredientSpecification _medicineSpecification;
private readonly IMapper _mapper;
public MedicalStateService(
IUnitOfWork<MedicalState> medicalUnitOfWork,
IUnitOfWork<Medicine> medicineUnitOfWork,
IUnitOfWork<Patient> patientUnitOfWork
IUnitOfWork<Patient> patientUnitOfWork,
IMapper Mapper
)
{
_medicalStateUnitOfWork = medicalUnitOfWork;
_medicalStateSpecification = new MedicalStateSpecification();
_MedicalStateUnitOfWork = medicalUnitOfWork;
_MedicalStateSpecification = new MedicalStateSpecification();
_medicineUnitOfWork = medicineUnitOfWork;
_patientService = new PatientService(patientUnitOfWork,medicalUnitOfWork);
_patientService = new PatientService(patientUnitOfWork,medicalUnitOfWork,Mapper);
_medicineSpecification = new MedicineIngredientSpecification();
_mapper = Mapper;
}
public MedicalState Add(int patientId , MedicalState medicalState)
public MedicalStateModel Add(int patientId , MedicalStateModel medicalStateModel)
{
var im = Create(medicalState);
_patientService.AddMedicalState(patientId ,im);
return im;
//var im = Create(medicalStateModel);
// _patientService.AddMedicalState(patientId ,_mapper.Map<MedicalState>( im));
medicalStateModel.PatientId = patientId;
var im =medicalStateModel;
var r = _MedicalStateUnitOfWork.Entity.Insert(_mapper.Map<MedicalState>(im));
_MedicalStateUnitOfWork.Save();
return _mapper.Map<MedicalStateModel>(r);
}
public MedicalState Create(MedicalState medicalState ) {
return _medicalStateUnitOfWork.Entity.Insert(medicalState);
public MedicalStateModel Create(MedicalStateModel medicalStateModel ) {
var medicalState = _mapper.Map<MedicalState>(medicalStateModel);
var e = _MedicalStateUnitOfWork.Entity.Insert(medicalState);
_MedicalStateUnitOfWork.Save();
return _mapper.Map<MedicalStateModel>(e);
}
public void AddMedicine(int medicalStateId, int medicineId)
public void AddMedicine(int MedicalStateId, int medicineId)
{
var m = _medicalStateUnitOfWork.Entity.GetById(medicalStateId, _medicalStateSpecification);
var m = _MedicalStateUnitOfWork.Entity.GetById(MedicalStateId, _MedicalStateSpecification).Result;
if (m.Medicines is null)
m.Medicines = new List<Medicine>();
var d =_medicineUnitOfWork.Entity.GetById(medicineId,_medicineSpecification );
var d = _medicineUnitOfWork.Entity.GetById(medicineId,_medicineSpecification ).Result;
m.Medicines.Add(d );
_medicalStateUnitOfWork.Entity.Update(m);
_medicalStateUnitOfWork.Save();
_MedicalStateUnitOfWork.Entity.Update(m);
_MedicalStateUnitOfWork.Save();
}
public void RemoveMedicine(int medicalStateId, int medicineId)
public void RemoveMedicine(int MedicalStateId, int medicineId)
{
var m = _medicalStateUnitOfWork.Entity.GetById(medicalStateId, _medicalStateSpecification);
var m = _MedicalStateUnitOfWork.Entity.GetById(MedicalStateId, _MedicalStateSpecification).Result;
if (m.Medicines is null)
m.Medicines = new List<Medicine>();
var d = _medicineUnitOfWork.Entity.GetById(medicineId, _medicineSpecification);
var d = _medicineUnitOfWork.Entity.GetById(medicineId, _medicineSpecification).Result;
m.Medicines.Remove(d);
_medicalStateUnitOfWork.Entity.Update(m);
_medicalStateUnitOfWork.Save();
_MedicalStateUnitOfWork.Entity.Update(m);
_MedicalStateUnitOfWork.Save();
}
public void Delete(int id)
{
_medicalStateUnitOfWork.Entity.Delete(id);
_medicalStateUnitOfWork.Save();
_MedicalStateUnitOfWork.Entity.Delete(id);
_MedicalStateUnitOfWork.Save();
}
public IEnumerable<MedicalState> GetAll()
public async Task<IEnumerable<MedicalStateModel>> GetAll()
{
return _medicalStateUnitOfWork.Entity.GetAll(_medicalStateSpecification);
return _mapper.Map<IEnumerable<MedicalStateModel>>(await _MedicalStateUnitOfWork.Entity.GetAll(_MedicalStateSpecification));
}
public IEnumerable<MedicalState> GetAllPatientMedicalStates(int patientId)
public IEnumerable<MedicalStateModel> GetAllPatientMedicalStates(int patientId)
{
return _patientService.GetPatientMedicalStates(patientId);
return _mapper.Map<IEnumerable<MedicalStateModel>>( _patientService.GetPatientMedicalStates(patientId));
}
public MedicalState GetDetails(int medicalStateId)
public async Task<MedicalStateModel> GetDetails(int MedicalStateId)
{
return _patientService.GetMedicalStateDetails(medicalStateId);
return _mapper.Map<MedicalStateModel>(await _patientService.GetMedicalStateDetails(MedicalStateId));
}
public MedicalState Update(MedicalState medicalState)
public MedicalStateModel Update(MedicalStateModel MedicalStateModel)
{
var r = _medicalStateUnitOfWork.Entity.Update(medicalState);
var MedicalState = _mapper.Map<MedicalState>(MedicalStateModel);
var r = _MedicalStateUnitOfWork.Entity.Update(MedicalState);
_medicalStateUnitOfWork.Save();
return r;
_MedicalStateUnitOfWork.Save();
return _mapper.Map<MedicalStateModel>(r);
}
}
}
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces;
using ApplicationCore.Interfaces.IServices;
using ApplicationCore.Specification;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -9,73 +10,88 @@ using System.Text;
using System.Threading.Tasks;
using ApplicationCore.Mapper;
using AutoMapper;
using ApplicationCore.ViewModel;
using ApplicationCore.DomainModel;
namespace ApplicationCore.Services
{
public class MedicineService : IMedicineService
{
private readonly MedicineMapper _mapper;
private readonly IMapper _mapper;
private readonly IUnitOfWork<Medicine> _medicineUnitOfWork;
private MedicineIngredientSpecification _medicineIngredientSpecification;
public MedicineService(
IUnitOfWork<Medicine> medicineUnitOfWork,
MedicineMapper medicineMapper )
IMapper medicineMapper )
{
_mapper = medicineMapper;
_medicineUnitOfWork = medicineUnitOfWork;
_medicineIngredientSpecification = new MedicineIngredientSpecification();
}
public IEnumerable<Medicine> GetAllMedicines() {
return _medicineUnitOfWork.Entity.GetAll(
public async Task<IEnumerable<MedicineModel>> GetAllMedicines() {
var m = _mapper.Map<IEnumerable<MedicineModel>>(await _medicineUnitOfWork.Entity.GetAll(
_medicineIngredientSpecification
);
));
return m ;
}
public void AddMedicine(Medicine medicine) {
_medicineUnitOfWork.Entity.Insert(medicine);
public MedicineModel Create (MedicineModel medicineModel) {
var r = _mapper.Map<MedicineModel>(new Medicine());
var rr = _mapper.Map<Medicine>(new MedicineModel());
var medicine = _mapper.Map<Medicine>(medicineModel);
var m = _medicineUnitOfWork.Entity.Insert(medicine);
_medicineUnitOfWork.Save();
return _mapper.Map<MedicineModel>(m);
}
public void AddMedicineIngredient(int medicineId ,Ingredient ingredient ) {
public void AddMedicineIngredient(int medicineId ,IngredientModel ingredientModel ) {
var s =_medicineUnitOfWork.Entity.GetById(medicineId,_medicineIngredientSpecification);
s.Ingredients.Add(ingredient);
var s = _medicineUnitOfWork.Entity.GetById(medicineId,_medicineIngredientSpecification).Result;
s.Ingredients.Add(_mapper.Map<Ingredient>(ingredientModel));
_medicineUnitOfWork.Entity.Update(s);
_medicineUnitOfWork.Save();
}
public Medicine Update(Medicine medicine) {
var r=_medicineUnitOfWork.Entity.Update(medicine);
public MedicineModel Update(MedicineModel medicineModel) {
var medicine = _mapper.Map<Medicine>(medicineModel);
var rm=_medicineUnitOfWork.Entity.Update(medicine);
_medicineUnitOfWork.Save();
var r =_mapper.Map<MedicineModel>(rm);
return r;
}
public Medicine GetDetails(int id)
public async Task<MedicineModel> GetDetails(int id)
{
var medicine = _mapper.Map<MedicineModel>(await _medicineUnitOfWork.Entity.GetById(id, _medicineIngredientSpecification));
return _medicineUnitOfWork.Entity.GetById(id, _medicineIngredientSpecification);
return medicine;
}
public Medicine GetMedicineIngredentisDetails(int medicineId) {
return _medicineUnitOfWork.Entity
public MedicineModel GetMedicineIngredentisDetails(int medicineId) {
return _mapper.Map<MedicineModel>(_medicineUnitOfWork.Entity
.GetById(medicineId ,
_medicineIngredientSpecification);
_medicineIngredientSpecification));
}
public void AddIngredient(int medicineId, int ratio ,Ingredient ingredient) {
var m = GetMedicineIngredentisDetails(medicineId);
if(ingredient.Id!= 0 )
foreach (var i in m.Ingredients) {
if (i.Id.Equals(ingredient.Id))
return;
}
m.AddIngredient(ingredient ,ratio );
public void AddIngredient(int medicineId, int ratio , IngredientModel ingredient)
{
// var m = _mapper.Map<Medicine>(GetMedicineIngredentisDetails(medicineId));
var m = _medicineUnitOfWork.Entity.GetById(medicineId,_medicineIngredientSpecification).Result;
_medicineUnitOfWork.Save();
if (ingredient.Id != 0)
foreach (var i in m.Ingredients)
{
if (i.Id.Equals(ingredient.Id))
return;
}
m.AddIngredient(_mapper.Map<Ingredient>(ingredient), ratio);
_medicineUnitOfWork.Entity.Update(m);
_medicineUnitOfWork.Save();
}
public void Delete(int id) {
_medicineUnitOfWork.Entity.Delete(id);
_medicineUnitOfWork.Save();
......
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces;
using ApplicationCore.Interfaces.IServices;
using ApplicationCore.Specification;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using ApplicationCore.DomainModel;
namespace ApplicationCore.Services
{
public class PatientService : IPatientService
{
private readonly IMapper _mapper;
private readonly IUnitOfWork<Patient> _patientUnitOfWork;
private readonly IUnitOfWork<MedicalState> _medicalStateUnitOfWork;
private PatientMedicinesSpecification _patientMedicinesSpecification;
......@@ -20,60 +24,67 @@ namespace ApplicationCore.Services
public PatientService(
IUnitOfWork<Patient> patientUnitOfWork,
IUnitOfWork<MedicalState> medicalStateUnitOfWork)
IUnitOfWork<MedicalState> medicalStateUnitOfWork,
IMapper mapper )
{
_mapper = mapper;
_patientUnitOfWork = patientUnitOfWork;
_medicalStateUnitOfWork = medicalStateUnitOfWork;
_patientMedicinesSpecification = new PatientMedicinesSpecification();
_medicalStateSpecification = new MedicalStateSpecification();
}
public IEnumerable<MedicalState> GetPatientMedicalStates(int patientId) {
public IEnumerable<MedicalStateModel> GetPatientMedicalStates(int patientId) {
return _patientUnitOfWork.Entity
return _mapper.Map<IEnumerable<MedicalStateModel>>( _patientUnitOfWork.Entity
.GetById(
patientId,_patientMedicinesSpecification
).MedicalStates.AsEnumerable();
).Result.MedicalStates.AsEnumerable());
}
public MedicalState GetMedicalStateDetails(int id, params Expression<Func<MedicalState, object>>[] includeProperties)
public async Task< MedicalStateModel> GetMedicalStateDetails(int id)
{
return _medicalStateUnitOfWork.Entity.GetById(id,_medicalStateSpecification);
return _mapper.Map<MedicalStateModel>(await _medicalStateUnitOfWork.Entity.GetById(id,_medicalStateSpecification));
}
public IEnumerable<Patient> GetAll(params Expression<Func<Patient, object>>[] includeProperties) {
return _patientUnitOfWork.Entity.GetAll(_patientMedicinesSpecification);
public async Task<IEnumerable<PatientModel>> GetAll() {
return _mapper.Map < IEnumerable < PatientModel >> (await _patientUnitOfWork.Entity.GetAll(_patientMedicinesSpecification));
}
public void AddMedicalState (int patientId, MedicalState medicalState) {
var ptient = _patientUnitOfWork.Entity.GetById(patientId,_patientMedicinesSpecification);
public void AddMedicalState (int patientId, MedicalStateModel medicalState) {
var ptient = _patientUnitOfWork.Entity.GetById(patientId,_patientMedicinesSpecification).Result;
ptient.MedicalStates.Add(medicalState);
ptient.MedicalStates.Add(_mapper.Map<MedicalState>(medicalState));
_patientUnitOfWork.Entity.Update(ptient);
_patientUnitOfWork.Save();
}
public Patient GetDetails(int id)
public async Task<PatientModel> GetDetails(int id)
{
return _patientUnitOfWork.Entity.GetById(id, _patientMedicinesSpecification);
return _mapper.Map < PatientModel>(await _patientUnitOfWork.Entity.GetById(id, _patientMedicinesSpecification));
}
public void Insert(Patient patient)
public void Insert(PatientModel patient)
{
_patientUnitOfWork.Entity.Insert(patient);
_patientUnitOfWork.Entity.Insert(_mapper.Map<Patient>(patient));
_patientUnitOfWork.Save();
}
public Patient Update(Patient patient)
public PatientModel Create(PatientModel patient) {
var p =_patientUnitOfWork.Entity.Insert(_mapper.Map<Patient>(patient));
return _mapper.Map<PatientModel>(p);
}
public PatientModel Update(PatientModel patient)
{
var p =_patientUnitOfWork.Entity.Update(patient);
var p =_patientUnitOfWork.Entity.Update(_mapper.Map<Patient>(patient));
_patientUnitOfWork.Save();
return p;
return _mapper.Map < PatientModel > (p);
}
public void Delete(int id)
{
......
......@@ -5,7 +5,7 @@ using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.ISpecification
namespace ApplicationDomain.Abstraction
{
public interface ISpecification<T> where T : class
{
......
using ApplicationDomain.Entities;
using ApplicationDomain.Repositories;
namespace ApplicationCore.Interfaces
namespace ApplicationDomain.Abstraction
{
public interface IUnitOfWork<T> where T : EntityBase
{
......
......@@ -17,4 +17,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Exceptions\" />
</ItemGroup>
</Project>
using ApplicationCore.Interfaces.ISpecification;
using ApplicationDomain.Abstraction;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -6,16 +6,16 @@ using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using ApplicationDomain.Entities;
namespace ApplicationCore.Interfaces
namespace ApplicationDomain.Repositories
{
public interface IGenericRepository<T> where T : EntityBase
{
public T Update(T entities);
public T Insert(T entities);
public T GetById(int id, ISpecification<T> specification = null );
public Task<T> GetById(int id, ISpecification<T> specification = null );
public void Delete(int id);
public IEnumerable<T> GetAll(ISpecification<T> specification);
public Task<IEnumerable<T>> GetAll(ISpecification<T> specification);
}
}
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationDomain.Repositories
{
public interface IMedicineRepository : IGenericRepository<Medicine>
{
public Medicine AddIngredient { get; set; }
}
}
using ApplicationCore.Interfaces.ISpecification;
using ApplicationDomain.Abstraction;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -6,7 +6,7 @@ using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Specification.BaseSpecification
namespace ApplicationDomain.Specification.BaseSpecification
{
public class BaseSpecification<T> : ISpecification<T> where T :class
{
......
using ApplicationDomain.Entities;
using ApplicationCore.Specification.BaseSpecification;
using ApplicationDomain.Specification.BaseSpecification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Specification
namespace ApplicationDomain.Specification
{
public class IngredientSpecification : BaseSpecification<Ingredient>
{
......
using ApplicationDomain.Entities;
using ApplicationCore.Specification.BaseSpecification;
using ApplicationDomain.Specification.BaseSpecification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Specification
namespace ApplicationDomain.Specification
{
class MedicalStateSpecification : BaseSpecification<MedicalState>
public class MedicalStateSpecification : BaseSpecification<MedicalState>
{
public MedicalStateSpecification()
......
using ApplicationDomain.Entities;
using ApplicationCore.Specification.BaseSpecification;
using ApplicationDomain.Specification.BaseSpecification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Specification
namespace ApplicationDomain.Specification
{
public class MedicineIngredientSpecification : BaseSpecification<Medicine>
{
......
using ApplicationDomain.Entities;
using ApplicationCore.Specification.BaseSpecification;
using ApplicationDomain.Specification.BaseSpecification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Specification
namespace ApplicationDomain.Specification
{
public class PatientMedicinesSpecification : BaseSpecification<Patient>
{
......
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces;
using ApplicationCore.Interfaces.ISpecification;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
......@@ -8,12 +7,14 @@ using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using ApplicationDomain.Repositories;
using ApplicationDomain.Abstraction;
namespace Infrastructure.Repository
{
public class GenericRepository<T> : IGenericRepository<T> where T : EntityBase
{
private readonly DbContext _context;
protected readonly DbContext _context;
private DbSet<T> _table;
public GenericRepository(DbContext context)
{
......@@ -26,25 +27,24 @@ namespace Infrastructure.Repository
_table.Remove(entity);
}
public IEnumerable<T> GetAll(ISpecification<T> specification)
public async Task<IEnumerable<T>> GetAll(ISpecification<T> specification)
{
IQueryable<T> queryable = _table;
queryable = GetQuery(queryable, specification);
return queryable.AsEnumerable();
return await queryable.ToListAsync();
}
public T GetById(int id, ISpecification<T> specification = null)
public async Task<T> GetById(int id, ISpecification<T> specification = null)
{
IQueryable<T> query = _table;
if(specification != null )
query = GetQuery(query, specification);
if (specification != null)
query = GetQuery(query, specification);
return query.Where(p => p.Id == id).FirstOrDefault();
return await query.Where(p => p.Id == id).FirstOrDefaultAsync();
}
public T Insert(T entity)
......
using ApplicationDomain.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Infrastructure.Repository
{
public class MedicineRepository : GenericRepository<Medicine>
{
public MedicineRepository(DbContext dbContext) : base(dbContext)
{
}
}
}
......@@ -7,6 +7,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Repositories;
namespace Infrastructure.UnitOfWork
{
......
59276fd161189aa79ddc03c1f9ef00f1917df3db
991ccf053c0d53df7ecd75be411e20caece31f5d
using ApplicationDomain.Entities;
using ApplicationCore.ViewModel;
using WebPresentation.ViewModel.Identity;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
......
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces;
using ApplicationCore.Specification.BaseSpecification;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
......@@ -15,8 +12,8 @@ namespace WebPresentation.Controllers
[Authorize]
public abstract class BaseController<T> : Controller where T : EntityBase
{
private readonly UserManager<User> _userManager;
private readonly IService<T> _service;
protected readonly UserManager<User> _userManager;
protected readonly IService<T> _service;
public BaseController(UserManager<User> userManager , IService<T> service) {
_userManager = userManager;
_service = service;
......@@ -25,14 +22,14 @@ namespace WebPresentation.Controllers
// Details
//
public IActionResult Details(int? id ) {
public virtual IActionResult Details(int? id ) {
if (id is null)
{
return NotFound();
}
else {
T TModel = _service.GetDetails((int)id);
T TModel = _service.GetDetails((int)id).Result;
if (TModel is null)
return NotFound();
return View(TModel);
......@@ -71,7 +68,7 @@ namespace WebPresentation.Controllers
return NotFound();
}
T tModel = _service.GetDetails((int)id);
T tModel = _service.GetDetails((int)id).Result;
if (tModel == null)
{
return NotFound();
......
......@@ -10,17 +10,15 @@ using System.Linq;
using System.Threading.Tasks;
using WebPresentation.Models;
using ApplicationCore.Interfaces.IServices;
using ApplicationCore.DomainModel;
namespace WebPresentation.Controllers
{
[Authorize(Roles ="patient")]
public class HomeController : BaseController<Patient>
public class HomeController : BaseController<PatientModel>
{
private readonly IPatientService _patientService;
private readonly IMedicineService _medicineService;
private readonly UserManager<User> _userManager;
public HomeController(
UserManager<User> userManager,
......@@ -28,30 +26,39 @@ namespace WebPresentation.Controllers
IMedicineService medicineService
):base(userManager,patientService)
{
_userManager = userManager;
_medicineService = medicineService;
_patientService = patientService;
}
public IActionResult Index()
{
private PatientModel _getCurrentPatient() {
var u = GetCurrentUser();
var userId = GetUserId();
var ownesr = _patientService
var patient = _patientService
.GetAll(
)
).Result
.Where(
u => u.User.Id == userId
)
.FirstOrDefault();
return patient;
}
public IActionResult Index()
{
return View(ownesr);
return View(_getCurrentPatient());
}
public override IActionResult Details(int? id ) {
return View(_getCurrentPatient());
}
public IActionResult Privacy() {
return View() ; }
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
......
......@@ -8,30 +8,27 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using ApplicationCore.DomainModel;
namespace WebPresentation.Controllers
{
[Authorize(Roles = "Admin")]
public class IngredientController : BaseController<Ingredient>
public class IngredientController : BaseController<IngredientModel>
{
private readonly IIngredientService _ingredientService;
private readonly IMedicineService _medicineService;
public IngredientController(UserManager<User> userManager,
IMedicineService medicineService ,
IIngredientService ingredientSercie
) : base(userManager,ingredientSercie)
{
_ingredientService =ingredientSercie;
_medicineService = medicineService;
}
public IActionResult Index()
{
var s = _ingredientService.GetAllIngredients();
var s = _ingredientService.GetAllIngredients().Result;
return View(s);
}
......@@ -47,23 +44,17 @@ namespace WebPresentation.Controllers
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Create(Ingredient ingredient, int id)
public IActionResult Create(IngredientModel ingredient, int id)
{
if (ModelState.IsValid)
{
_ingredientService.AddIngredient(ingredient);
_ingredientService.Create(ingredient);
return RedirectToAction(nameof(Index));
}
return View(ingredient);
}
public IActionResult AddIngredints(int id)
{
var s = _ingredientService.GetAllIngredients();
ViewBag.MedicineId = id;
return View(s);
}
......
......@@ -8,12 +8,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ApplicationCore.DomainModel;
namespace WebPresentation.Controllers
{
[Authorize(Roles = "patient")]
public class MedicalStateController : BaseController<MedicalState>
public class MedicalStateController : BaseController<MedicalStateModel>
{
private readonly IMedicalStateService _medicalStateService;
private readonly IPatientService _patientService;
......@@ -34,8 +35,8 @@ namespace WebPresentation.Controllers
public IActionResult Index( )
{
var u = GetUserId();
var pId = _patientService.GetAll().Where(p => p.User.Id == u).FirstOrDefault().Id;
var meds = _medicalStateService.GetAllPatientMedicalStates(pId);
var pId = _patientService.GetAll().Result.Where(p => p.User.Id == u).FirstOrDefault().Id;
var meds =((IMedicalStateService )_service).GetAllPatientMedicalStates(pId);
return View(meds);
}
......@@ -49,25 +50,27 @@ namespace WebPresentation.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Create(MedicalState medicalState, int id)
public IActionResult Create(MedicalStateModel medicalState, int id)
{
if (ModelState.IsValid)
{
var uId = GetUserId();
var p = _patientService.GetAll(
)
).Result
.Where(
u => u.User.Id == uId
)
.FirstOrDefault().Id;
if (medicalState.PrescriptionTime == DateTime.MinValue )
medicalState.PrescriptionTime = DateTime.Now;
var n= _medicalStateService.Add(p,medicalState);
return RedirectToAction("Details", "MedicalState", new { Id = n.Id });
var n= ((IMedicalStateService)_service).Add(p,medicalState);
return RedirectToAction("Details", "MedicalState" , new { Id =n.Id });
}
return View(medicalState);
}
[HttpGet]
public IActionResult AddMedicine(int id)
{
......@@ -83,6 +86,26 @@ namespace WebPresentation.Controllers
return RedirectToAction("Details", "MedicalState", new { Id = id });
}
[HttpPost]
public JsonResult AddMedicineT(
int id,
int med)
{
try
{
_medicalStateService.AddMedicine(id, med);
return Json("Added");
}
catch (Exception e ) {
return Json("faild");
}
}
[HttpPost]
public IActionResult RemoveMedicine(int id, int med)
{
......@@ -91,5 +114,18 @@ namespace WebPresentation.Controllers
return RedirectToAction("Details", "MedicalState", new { Id = id });
}
[HttpPost]
public JsonResult RemoveMedicineJ(int id, int med)
{
_medicalStateService.RemoveMedicine(id, med);
return Json("Reomved");
}
public JsonResult GetMedicalStateMedicine(int id) {
var r = _medicalStateService.GetDetails(id).Result.Medicines;
return Json(r);
}
}
}
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces.IServices;
using ApplicationCore.Services;
using ApplicationCore.ViewModel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
......@@ -12,11 +10,11 @@ using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using ApplicationCore.DomainModel;
namespace WebPresentation.Controllers
{
[Authorize(Roles ="Admin")]
public class MedicineController : BaseController<Medicine>
public class MedicineController : BaseController<MedicineModel>
{
private readonly IIngredientService _ingredientService;
private readonly IMedicineService _medicineService;
......@@ -35,53 +33,79 @@ namespace WebPresentation.Controllers
}
[Authorize(Roles = "Admin")]
public IActionResult Index()
{
var s = new PatientMedicineViewModel
{
Patients = _patientService.GetAll(p=> p.User ),
Medicines = _medicineService.GetAllMedicines()
};
var s = _medicineService.GetAllMedicines().Result;
return View(s);
}
[Authorize(Roles = "Admin")]
// 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.
[Authorize(Roles = "Admin")]
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Create(Medicine medicine, int id)
public IActionResult Create(MedicineModel medicine, int id)
{
if (ModelState.IsValid)
{
_medicineService.AddMedicine(medicine);
return RedirectToAction(nameof(Index));
var m = _medicineService.Create(medicine);
return RedirectToAction("Details","Medicine",new { Id = m.Id});
}
return View(medicine);
}
[Authorize(Roles = "Admin")]
public IActionResult AddIngredints(int id ) {
var s = _ingredientService.GetAllIngredients();
var s = _ingredientService.GetAllIngredients().Result;
ViewBag.MedicineId = id;
return View(s);
}
[Authorize(Roles = "Admin")]
[HttpPost]
public IActionResult AddIngredints(int id , int med ,int ratio )
{
var s = _ingredientService.GetDetails(id);
_medicineService.AddIngredient(med, ratio, s);
_ingredientService.AddToMedicine(id,med,ratio);
return RedirectToAction("Details","Medicine", new { Id = med}) ;
}
[Authorize(Roles ="patient")]
public async Task<JsonResult> GetDetails(int? id)
{
if (id is null)
{
return Json("");
}
else
{
MedicineModel TModel = await _service.GetDetails((int)id);
if (TModel is null)
return Json("");
return Json(TModel);
}
}
[Authorize(Roles = "patient")]
[HttpGet]
public JsonResult GetMedicines()
{
var all = _medicineService.GetAllMedicines().Result;
return new JsonResult(all);
}
}
}
using ApplicationCore.DomainModel;
using ApplicationCore.Interfaces.IServices;
using ApplicationDomain.Entities;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebPresentation.ViewModel.Identity;
namespace WebPresentation.Controllers
{
public class PatientsController : BaseController<PatientModel>
{
private readonly IMedicalStateService _medicalStateService;
private readonly IPatientService _patientService;
private readonly IMedicineService _medicineService;
private readonly SignInManager<User> _signInManager;
public PatientsController(UserManager<User> userManager,
IMedicalStateService medicalStateService,
IPatientService patientService,
IMedicineService medicineService,
SignInManager<User> signInManager
) : base(userManager, patientService)
{
_signInManager = signInManager;
_medicalStateService = medicalStateService;
_patientService = patientService;
_medicineService = medicineService;
}
public IActionResult Index()
{
var patiens = ((IPatientService)_service).GetAll().Result;
return View(patiens);
}
public IActionResult Create()
{
return View();
}
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Create(RegisterationInputModel Input, int id)
{
if (ModelState.IsValid)
{
var user = new User
{
NormalizedEmail = Input.Email,
FirstName = Input.FirstName,
LastName = Input.LastName,
Avatar = Input.Avatar,
UserName = Input.Email,
Email = Input.Email,
Patient = Input.Patient,
CreationTime = DateTime.Now,
};
var result =_userManager.CreateAsync(user, Input.Password).Result;
if (result.Succeeded) {
return RedirectToAction("Index", "Patients");
}
else return View(Input);
}
return View(Input);
}
}
}
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces;
using ApplicationCore.Interfaces.IServices;
using ApplicationCore.Services;
using Infrastructure.Data;
......@@ -8,13 +7,14 @@ using Infrastructure.UnitOfWork;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using ApplicationCore.Mapper;
using AutoMapper;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Repositories;
namespace WebPresentation
{
......@@ -32,8 +32,9 @@ namespace WebPresentation
{
services.AddScoped<DbContext, MedicDbContext>();
services.AddScoped<MedicineMapper>();
services.AddScoped<Mapper>();
services.AddAutoMapper(typeof(ApplicationCore.Mapper.ObjectMapper));
#region ADD Scoped Repository
services.AddScoped(typeof(IUnitOfWork<>),typeof(UnitOfWork<>));
services.AddScoped(typeof(IGenericRepository<>), typeof(GenericRepository<>));
......@@ -58,18 +59,23 @@ namespace WebPresentation
#region ADD Identity
services
.AddIdentity<User, IdentityRole>()
.AddEntityFrameworkStores<MedicDbContext>();
.AddEntityFrameworkStores<MedicDbContext>()
.AddDefaultTokenProviders();
#endregion ADD Identity
#region ADD Authentication Schema
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(
options =>
{
options.LoginPath = "Access/Login";
options.LogoutPath = "Access/Logout";
options.AccessDeniedPath = "Access/Login";
options.LoginPath = "/Access/Login";
options.LogoutPath = "/Access/Logout";
options.AccessDeniedPath = "/Access/Login";
}
);
services.AddAuthorization(
);
#endregion ADD Authentication Schema
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace WebPresentation.View_Models
{
public class BaseViewModel
{
public int Id { get; set; }
}
}
......@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.ViewModel
namespace WebPresentation.ViewModel.Identity
{
public class LoginInuptModel
{
......
......@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.ViewModel
namespace WebPresentation.ViewModel.Identity
{
public class RegisterationInputModel
{
......
......@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.ViewModel
namespace WebPresentation.ViewModel
{
public class PatientMedicineViewModel
{
......
......@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.ViewModel
namespace WebPresentation.ViewModel
{
public class PatientMedicinesViewModel
{
......
@model ApplicationCore.ViewModel.LoginInuptModel
@model WebPresentation.ViewModel.Identity.LoginInuptModel
@{
ViewData["Title"] = "Log in";
......@@ -25,7 +25,7 @@
<i class="fas fa-cubes fa-2x me-3" style="color: #ff6219;"></i>
<span class="h1 fw-bold mb-0">Logo</span>
</div>
<input hidden asp-for="@Model.ReturnUrl" value="@ViewBag.ReturnUrl"/>
<input hidden asp-for="@Model.ReturnUrl" value="@ViewBag.ReturnUrl" />
<h5 class="fw-normal mb-3 pb-3" style="letter-spacing: 1px;">Sign into your account</h5>
<div data-mdb-input-init class="form-outline mb-4">
......@@ -52,7 +52,7 @@
<button data-mdb-button-init data-mdb-ripple-init class="btn btn-dark btn-lg btn-block" role="submit">Login</button>
</div>
<a id="forgot-password" class="small text-muted" >Forgot your password?</a>
<a id="forgot-password" class="small text-muted">Forgot your password?</a>
<p class="mb-5 pb-lg-2" style="color: #393f81;">
Don't have an account? <a style="color: #393f81;" asp-controller="Access" asp-action="Register" asp-route-returnUrl="@ViewBag.ReturnUrl">
Register Here
......
@model ApplicationCore.ViewModel.RegisterationInputModel ;
@model WebPresentation.ViewModel.Identity.RegisterationInputModel;
@{
ViewData["Title"] = "Register";
}
......
@model PatientModel
<style>
.form-control:focus {
box-shadow: none;
border-color: #BA68C8
}
.profile-button {
background: rgb(99, 39, 120);
box-shadow: none;
border: none
}
.profile-button:hover {
background: #682773
}
.profile-button:focus {
background: #682773;
box-shadow: none
}
.profile-button:active {
background: #682773;
box-shadow: none
}
.back:hover {
color: #682773;
cursor: pointer
}
.labels {
font-size: 11px
}
.add-experience:hover {
background: #BA68C8;
color: #fff;
cursor: pointer;
border: solid 1px #BA68C8
}
</style>
<section class="page-section">
<div class="container rounded bg-white mt-5 mb-5">
<div class="row">
<div class="col-md-3 border-right">
<div class="d-flex flex-column align-items-center text-center p-3 py-5">
<img class="rounded-circle mt-5" width="150px" src="/img/@Model.User.Avatar"><span class="font-weight-bold">@Model.User.FirstName</span><span class="text-black-50">@Model.User.Email</span><span> </span></div>
</div>
<div class="col-md-5 border-right">
<div class="p-3 py-5">
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="text-right">Profile Settings</h4>
</div>
<div class="row mt-2">
<div class="col-md-6">
<label class="labels">@Model.User.FirstName</label>
</div>
<div class="col-md-6">
<label class="labels"> @Model.User.LastName</label>
</div>
</div>
<div class="row mt-3">
<div class="col-md-12">
<label class="labels">@Model.BIO</label>
</div>
<div class="col-md-12">
<label class="labels">@Model.User.UserName</label>
</div>
<div class="col-md-12">
<label class="labels">Created at @Model.User.CreationTime</label>
</div>
<div class="col-md-12">
<label class="labels">has a @Model.MedicalStates.Count() medical cases</label>
</div>
</div>
<div class="mt-5 text-center"><button class="btn btn-primary profile-button" type="button">Go Home</button></div>
</div>
</div>
<div class="col-md-4">
<div class="p-3 py-5">
<div class="d-flex justify-content-between align-items-center experience">
<span>
</span>
</div><br>
</div>
</div>
</div>
</div>
</section>
\ No newline at end of file
@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}
@model PatientModel
<style>
.form-control:focus {
box-shadow: none;
border-color: #BA68C8
}
.profile-button {
background: rgb(99, 39, 120);
box-shadow: none;
border: none
}
.profile-button:hover {
background: #682773
}
.profile-button:focus {
background: #682773;
box-shadow: none
}
.profile-button:active {
background: #682773;
box-shadow: none
}
.back:hover {
color: #682773;
cursor: pointer
}
.labels {
font-size: 11px
}
.add-experience:hover {
background: #BA68C8;
color: #fff;
cursor: pointer;
border: solid 1px #BA68C8
}
</style>
<section class="page-section">
<form method="post" asp-action="Edit" asp-controller="Home">
<div class="container rounded bg-white mt-5 mb-5">
<div class="row">
<div class="col-md-3 border-right">
<div class="d-flex flex-column align-items-center text-center p-3 py-5">
<img class="rounded-circle mt-5" width="150px" src="/img/@Model.User.Avatar"><span class="font-weight-bold">@Model.User.FirstName</span><span class="text-black-50">@Model.User.Email</span><span> </span>
</div>
</div>
<div class="col-md-5 border-right">
<div class="p-3 py-5">
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="text-right">Profile Settings</h4>
</div>
<div class="row mt-2">
<div class="col-md-6"><label asp-for="@Model.User.FirstName" class="labels"></label>
<input asp-for="@Model.User.FirstName" class="form-control" ></div>
<div class="col-md-6"><label class="labels" asp-for="@Model.User.LastName"></label>
<input type="text" class="form-control" asp-for="@Model.User.LastName"></div>
</div>
<div class="row mt-3">
<div class="col-md-12"><label class="labels" asp-for="@Model.BIO"></label><input type="text" class="form-control" asp-for="@Model.BIO"></div>
<div class="col-md-12"><label class="labels"asp-for="@Model.User.UserName"></label><input type="text" class="form-control" asp-for="@Model.User.UserName"></div>
</div>
<div class="row mt-3">
<div class="col-md-12"><label class="labels" asp-for="@Model.User.Avatar"></label><input type="text" class="form-control" asp-for="@Model.User.Avatar"></div>
</div>
<div class="mt-5 text-center"><button class="btn btn-primary profile-button" role="submit" type="button">Save Profile</button></div>
</div>
</div>
</div>
</div>
</form>
</section>
\ No newline at end of file

@using Microsoft.AspNetCore.Identity ;
@model Patient ;
@model PatientModel ;
@inject SignInManager<User> SignInManager
@inject UserManager<User> UserManager
......@@ -76,7 +76,7 @@
<h4>@item.StateName</h4>
<p class="text-start">Diagonistic : @item.StateDescription<br /> Prescriped at : @(item.PrescriptionTime) </p>
<a data-toggle="modal" data-target="#item-@(item.Id)" class="btn btn-primary">
<a data-toggle="modal" data-target="#item-@(item.Id)" class="btn btn-primary" style="color:white!important">
Details
</a>
</div>
......@@ -140,8 +140,8 @@
<section class="page-section bg-primary text-white mb-0" id="topThree">
<div class="container-fluid">
<!-- Portfolio Section Heading -->
<h2 class=" page-section-heading text-center text-uppercase text-secondary mb-0">For more Medicine</h2><br />
<h2 class=" page-section-heading text-center text-secondary mb-0" style="color :white!important ;"><a asp-action="Index" asp-controller="MedicalState">Go to You Medical States profile</a> </h2>
<h2 class=" text-center text-uppercase text-secondary mb-0">For more Profile Details </h2><br />
<h2 class=" text-center text-secondary mb-0" style="color :white!important ;"><a asp-action="Details" asp-controller="Home">Go to Your profile</a> </h2>
<!-- Icon Divider -->
</div>
......
@model Ingredient
@model IngredientModel
@{
ViewData["Title"] = "Create";
......
@model Ingredient
@model IngredientModel
@{
ViewData["Title"] = "Delete";
......
@model Ingredient
@model IngredientModel
@{
ViewData["Title"] = "Details";
......@@ -16,7 +16,7 @@
<img src="~/img/portfolio/instagram.png"
alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
<h5>@Model.Name</h5>
<p>For: @Model.Medicines.Count()</p>
<a asp-action="Edit" asp-route-id="@Model.Id">
<i class="far fa-edit mb-5"></i>
</a>
......
@model Ingredient;
@model IngredientModel;
@{
ViewData["Title"] = "Edit";
......
@model IEnumerable<Ingredient>
@model IEnumerable<IngredientModel>
@{
ViewData["Title"] = "Index";
......
@model IEnumerable<Medicine>
@model IEnumerable<MedicineModel>
@(ViewData["Title"]="Medicines Galary")
@{
var t = 0;
}
<div id="toast-container">
</div>
<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">
class="carousel slide carousel-dark text-center">
<!-- Inner -->
<div class="carousel-inner py-4">
<!-- Single item -->
......@@ -14,7 +19,7 @@
<div class="row">
@foreach (var item in Model)
{
<div class="col-lg-4">
<div class="col-lg-4 col-md-6 d-flex flex-column align-items-stretch mb-5">
<div class="card m-3">
<img src="/img/portfolio/@item.Image"
class="card-img-top img-fluid" style="max-height:250px "
......@@ -26,24 +31,155 @@
<br />
Price : @item.Price <br />
Type : @item.MedicineType
Type : @(item.MedicineType is null ? "No Type" : item.MedicineType.TypeName )
</p>
<form class="form-inline" method="post" asp-action="AddMedicine" asp-controller="MedicalState" asp-route-med="@item.Id" asp-route-id="@ViewBag.MedicalStateId">
<button role="submit" class="btn btn-primary">Add to my Profile</button>
</form>
<div class="row justify-content-center">
<a data-toggle="modal" class="col col-auto btn btn-primary"
data-target="#item-@(item.Id)" style="color:white!important">
Details
</a>
<form class="form-inline col col-auto " method="post" asp-action="AddMedicine" asp-controller="MedicalState" asp-route-med="@item.Id" asp-route-id="@ViewBag.MedicalStateId">
<button role="submit" class="btn btn-primary">Add </button>
</form>
<button id="r" onclick="fu(@item.Id ,@ViewBag.MedicalStateId )" class="btn btn-primary">Add Json </button>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
<!-- Inner -->
</div>
</div>
@foreach (var item in Model)
{
<!-- Modal -->
<div class="modal fade" id="item-@(item.Id)" tabindex="-1" aria-labelledby="label-@item.Id" role="dialog"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header border-bottom-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
<i class="fas fa-times"></i>
</span>
</button>
</div>
<div class="modal-body text-start p-3">
<h5 class="modal-title text-uppercase mb-5" id="exampleModalLabel">@item.TradeName</h5>
<p class=" mb-5"> Manufacuture : @item.ManufactureName</p>
<p class=" mb-5"> Side Effect : @item.SideEffect</p>
<p class="mb-0">Ingredients Summary</p>
<hr class="mt-2 mb-4"
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
<div class="d-flex justify-content-between">
<p class="fw-bold mb-0">#</p>
<p class="fw-bold mb-0">Ingredient Name</p>
<p class="text-muted mb-0">Ratio</p>
</div>
@foreach (var i in item.MedicineIngredients)
{
<div class="d-flex justify-content-between">
<p class="fw-bold mb-0">@(t+1)</p>
<p class="fw-bold mb-0">@i.Ingredient.Name</p>
<p class="text-muted mb-0">@i.Ratio</p>
</div>
}
<hr class="mt-2 mb-4"
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
<div class="d-flex justify-content-between">
<p class="fw-bold">Price</p>
<p class="fw-bold">$@item.Price</p>
</div>
</div>
<div class="modal-footer d-flex justify-content-center border-top-0 py-4">
<form class="form-inline" method="post" asp-action="AddMedicine" asp-controller="MedicalState" asp-route-med="@item.Id" asp-route-id="@ViewBag.MedicalStateId">
<button role="submit" class="btn btn-primary">Add to my Profile</button>
</form>
</div>
</div>
</div>
</div>
<!-- Inner -->
</div>
}
<!-- Carousel wrapper -->
</section>
\ No newline at end of file
</section>
@section Scripts {
<script>
async function fu(med, id) {
try {
debugger;
let response = await fetch(`/MedicalState/AddMedicineT?id=${id}&med=${med}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ id: id, med: med })
});
if (response.ok) {
let result = await response.json();
console.log(result); // "Added" if successful
showToast(result,"medicine");
} else {
console.error('Error:', response.statusText);
alert('Failed to add medicine');
}
} catch (error) {
console.error('Fetch error:', error);
alert('Failed to add medicine');
}
}
function showToast(message, title) {
// Create the toast element
let toast = document.createElement('div');
toast.className = 'toast';
toast.setAttribute('role', 'alert');
toast.setAttribute('aria-live', 'assertive');
toast.setAttribute('aria-atomic', 'true');
toast.innerHTML = `
<div class="toast">
<div class="toast-header">
Toast Header
</div>
<div class="toast-body">
Some text inside the toast body
</div>
</div> `;
// Append the toast to the container
let y = document.getElementById('toast-container');
y.innerHTML =toast;
alert(1);
// Show the toast
$(toast).toast({ delay: 3000 });
$(toast).toast('show');
// Remove the toast after it is hidden
$(toast).on('hidden.bs.toast', function () {
$(this).remove();
});
}
</script>
}
@model MedicalState
@model MedicalStateModel
@{
ViewData["Title"] = "Create";
......
@model MedicalState
@model MedicalStateModel
@{
ViewData["Title"] = "Delete";
......
@model MedicalState
@model MedicalStateModel
@{
ViewData["Title"] = "Edit";
......
@model IEnumerable<MedicalState>;
@model IEnumerable<MedicalStateModel>;
@{
ViewData["Title"] = "Medical states ";
......
@model IEnumerable<Ingredient>
@model IEnumerable<IngredientModel>
@{
}
<section class="page-section p-5 m-5">
......
@model Medicine
@model MedicineModel
@{
ViewData["Title"] = "Create";
......@@ -14,7 +14,7 @@
<div class="row">
<form asp-action="Create">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<div class="form-group row">
<div class="col-5">
<label asp-for="TradeName" class="control-label"></label>
<input asp-for="TradeName" class="form-control" />
......@@ -26,7 +26,7 @@
<span asp-validation-for="ScintificName" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<div class="col-5">
<label asp-for="Description" class="control-label"></label>
<input asp-for="Description" class="form-control" />
......@@ -38,7 +38,7 @@
<span asp-validation-for="SideEffect" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label asp-for="Dosage" class="control-label"></label>
<input asp-for="Dosage" class="form-control" />
<span asp-validation-for="Dosage" class="text-danger"></span>
......
@model Medicine
@model MedicineModel
@{
ViewData["Title"] = "Delete";
......
@model Medicine
@model MedicineModel
@{
ViewData["Title"] = "Medicine Details ";
......
@model Medicine;
@model MedicineModel;
@{
ViewData["Title"] = "Edit";
......@@ -15,17 +15,21 @@
<div class="col-md-4">
<form asp-action="Edit" class="form-group ">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="TradeName" class="control-label "></label>
<input asp-for="TradeName" class="form-control" />
<span asp-validation-for="TradeName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Description" class="control-label"></label>
<input asp-for="Description" class="form-control" />
<span asp-validation-for="Description" class="text-danger"></span>
<div class="form-group row">
<div class="col">
<label asp-for="TradeName" class="control-label "></label>
<input asp-for="TradeName" class="form-control" />
<span asp-validation-for="TradeName" class="text-danger"></span>
</div>
<div class="col">
<label asp-for="Description" class="control-label"></label>
<input asp-for="Description" class="form-control" />
<span asp-validation-for="Description" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<div class="col ">
<label asp-for="Dosage" class="control-label"></label>
<input asp-for="Dosage" class="form-control" />
......@@ -38,7 +42,7 @@
<span asp-validation-for="Price" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<div class="col ">
<label for="Category.Name" class="control-label"></label>
<input asp-for="Category.Name" class="form-control" />
......@@ -51,7 +55,7 @@
<span asp-validation-for="ManufactureName" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<div class="col ">
<label asp-for="ScintificName" class="control-label"></label>
<input asp-for="ScintificName" class="form-control" />
......@@ -64,7 +68,7 @@
<span asp-validation-for="MedicineType.TypeName" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<div class="col ">
<label asp-for="SideEffect" class="control-label"></label>
<input asp-for="SideEffect" class="form-control" />
......@@ -72,7 +76,7 @@
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label asp-for="Image" class="control-label"></label>
<input asp-for="Image" class="form-control" />
<span asp-validation-for="Image" class="text-danger"></span>
......
@model ApplicationCore.ViewModel.PatientMedicineViewModel;
@model IEnumerable<MedicineModel>;
@{
ViewData["Title"] = "Index";
......@@ -12,102 +11,13 @@
<div class="card bg-primary text-white mb-4">
<div class="card-body">Medicine Counts </div>
<div class="card-footer d-flex align-items-center justify-content-between">
<a class="small text-white stretched-link" href="#"> @Model.Medicines.Count()</a>
<div class="small text-white"><i class="fas fa-angle-right"></i></div>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card bg-warning text-white mb-4">
<div class="card-body">Patient Counts </div>
<div class="card-footer d-flex align-items-center justify-content-between">
<a class="small text-white stretched-link" href="#">@Model.Patients.Count()</a>
<a class="small text-white stretched-link" href="#"> @Model.Count()</a>
<div class="small text-white"><i class="fas fa-angle-right"></i></div>
</div>
</div>
</div>
</div>
<div>
<table id="datatablesSimple" class="table">
<thead>
<tr>
<th scope="col">
@Html.DisplayNameFor(model => model.Patients.First().Id)
</th>
<th scope="col">
@Html.DisplayNameFor(model => model.Patients.First().User.FirstName)
</th>
<th scope="col">
@Html.DisplayNameFor(model => model.Patients.First().User.LastName)
</th>
<th scope="col">
@Html.DisplayNameFor(model => model.Patients.First().BIO)
</th>
<th scope="col">
@Html.DisplayNameFor(model => model.Patients.First().User.CreationTime)
</th>
<th scope="col">
Manage
</th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="row">ID</th>
<th>First name</th>
<th>Last name</th>
<th>BIO</th>
<th>Creation Time</th>
<th>Manage</th>
</tr>
</tfoot>
<tbody>
@foreach (var item in Model.Patients)
{
<tr>
<td scope="row">
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.User.FirstName)
</td>
<td>
@Html.DisplayFor(modelItem => item.User.LastName)
</td>
<td>
@Html.DisplayFor(modelItem => item.BIO)
</td>
<td>
@Html.DisplayFor(modelItem => item.User.CreationTime)
</td>
<td>
<a asp-action="Edit" asp-controller="Patients" asp-route-id="@item.Id"><i class="far fa-pen-to-square text-bg-info"></i></a>
<a asp-action="Details" asp-controller="Patients" asp-route-id="@item.Id"><i class="far fa-address-card"></i></a>
<a asp-action="Delete" asp-controller="Patients" asp-route-id="@item.Id"><i class="far fa-trash-can text-bg-danger"></i></a>
</td>
</tr>
}
</tbody>
</table>
</div>
<hr />
<div>
<i class=""></i>
......@@ -122,15 +32,15 @@
<th scope="col">
@Html.DisplayNameFor(model => model.Medicines.First().Id)
@Html.DisplayNameFor(model => model.First().Id)
</th>
<th scope="col">
@Html.DisplayNameFor(model => model.Medicines.First().TradeName)
@Html.DisplayNameFor(model => model.First().TradeName)
</th>
<th scope="col">
@Html.DisplayNameFor(model => model.Medicines.First().Description)
@Html.DisplayNameFor(model => model.First().Description)
</th>
<th scope="col">
Category
......@@ -139,7 +49,7 @@
Type
</th>
<th scope="col">
@Html.DisplayNameFor(model => model.Medicines.First().Price)
@Html.DisplayNameFor(model => model.First().Price)
</th>
<th scope="col">
......@@ -162,12 +72,11 @@
<th>Type</th>
<th>Price</th>
<th>Manage</th>
<th>Patients Count </th>
</tr>
</tfoot>
<tbody>
@foreach (var item in Model.Medicines)
@foreach (var item in Model)
{
<tr>
......@@ -195,9 +104,6 @@
<a asp-action="Details" asp-controller="Medicine" asp-route-id="@item.Id"><i class="far fa-address-card"></i></a>
<a asp-action="Delete" asp-controller="Medicine" asp-route-id="@item.Id"><i class="far fa-trash-can text-bg-danger"></i></a>
</td>
<td>
@Html.DisplayFor(modelItem => item.MedicalStates.Count)
</td>
</tr>
}
</tbody>
......
......@@ -41,7 +41,7 @@
<a class="dropdown-item"
asp-action="Logout"
asp-controller="Access"
asp-route-returnUrl="/Home/Inedx">
asp-route-returnUrl="/Home/Index">
Logout
</a>
......
@using WebPresentation
@using WebPresentation.Models
@using ApplicationDomain.Entities;
@using ApplicationCore.DomainModel;
@using ApplicationDomain.Entities;
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using System
\ No newline at end of file
......@@ -25,4 +25,8 @@
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Views\Patients\" />
</ItemGroup>
</Project>
......@@ -27,20 +27,27 @@ using WebPresentation.Models;
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
#line 6 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"d8ddb6bffa5a9b264bf8f89038bf03c234083fd3", @"/Views/Home/Privacy.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"e6fffd8dfe80957a1cbddaf47a216a7c128d6cf7", @"/Views/_ViewImports.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
public class Views_Home_Privacy : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
{
#pragma warning disable 1998
......
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "4a9c464cd957f4a2db1817e42de1eac9cf0c295d"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Delete.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "e6911b7e947142b30f1a3f9749d60796b8ca6d3b"
// <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")]
......@@ -27,21 +27,28 @@ using WebPresentation.Models;
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
#line 6 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a9c464cd957f4a2db1817e42de1eac9cf0c295d", @"/Views/Ingredient/Delete.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"e6fffd8dfe80957a1cbddaf47a216a7c128d6cf7", @"/Views/_ViewImports.cshtml")]
public class Views_Ingredient_Delete : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<Ingredient>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"e6911b7e947142b30f1a3f9749d60796b8ca6d3b", @"/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>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "hidden", 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("asp-action", "Index", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
......@@ -118,9 +125,9 @@ using System;
#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, "4a9c464cd957f4a2db1817e42de1eac9cf0c295d6444", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e6911b7e947142b30f1a3f9749d60796b8ca6d3b6636", async() => {
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "4a9c464cd957f4a2db1817e42de1eac9cf0c295d6710", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "e6911b7e947142b30f1a3f9749d60796b8ca6d3b6902", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
......@@ -143,7 +150,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, "4a9c464cd957f4a2db1817e42de1eac9cf0c295d8492", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e6911b7e947142b30f1a3f9749d60796b8ca6d3b8684", async() => {
WriteLiteral("Back to List");
}
);
......@@ -186,7 +193,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<Ingredient> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<IngredientModel> Html { get; private set; }
}
}
#pragma warning restore 1591
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "bd1a3f3afb1c9b5d34889221087c22742e91c4a1"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a431c677f3ec91d9e3d93905e0fee08e9d7df25b"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Ingredient_Details), @"mvc.1.0.view", @"/Views/Ingredient/Details.cshtml")]
......@@ -27,21 +27,28 @@ using WebPresentation.Models;
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
#line 6 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"bd1a3f3afb1c9b5d34889221087c22742e91c4a1", @"/Views/Ingredient/Details.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"e6fffd8dfe80957a1cbddaf47a216a7c128d6cf7", @"/Views/_ViewImports.cshtml")]
public class Views_Ingredient_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<Ingredient>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"a431c677f3ec91d9e3d93905e0fee08e9d7df25b", @"/Views/Ingredient/Details.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
public class Views_Ingredient_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IngredientModel>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/img/portfolio/instagram.png"), 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("alt", new global::Microsoft.AspNetCore.Html.HtmlString("Avatar"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
......@@ -94,7 +101,7 @@ using System;
<div class=""col-md-4 gradient-custom text-center text-black""
style=""border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;"">
");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "bd1a3f3afb1c9b5d34889221087c22742e91c4a16443", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "a431c677f3ec91d9e3d93905e0fee08e9d7df25b6635", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
......@@ -118,16 +125,8 @@ using System;
#line default
#line hidden
#nullable disable
WriteLiteral("</h5>\r\n <p>For: ");
#nullable restore
#line 19 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Details.cshtml"
Write(Model.Medicines.Count());
#line default
#line hidden
#nullable disable
WriteLiteral("</p>\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "bd1a3f3afb1c9b5d34889221087c22742e91c4a18324", async() => {
WriteLiteral("</h5>\r\n \r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a431c677f3ec91d9e3d93905e0fee08e9d7df25b8250", async() => {
WriteLiteral("\r\n <i class=\"far fa-edit mb-5\"></i>\r\n ");
}
);
......@@ -158,7 +157,7 @@ using System;
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral(" \r\n \r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "bd1a3f3afb1c9b5d34889221087c22742e91c4a110641", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a431c677f3ec91d9e3d93905e0fee08e9d7df25b10567", async() => {
WriteLiteral("\r\n\r\n <i class=\"far fa-backward\">\r\n\r\n </i>\r\n ");
}
);
......@@ -216,7 +215,7 @@ using System;
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<Ingredient> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<IngredientModel> Html { get; private set; }
}
}
#pragma warning restore 1591
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "73fb231ac798781ebdb3a7811abecbb78ae062d4"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "17e165cd546d9b403ea75a1b085b72fcd2359e67"
// <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")]
......@@ -27,21 +27,28 @@ using WebPresentation.Models;
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
#line 6 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using System;
#line default
#line hidden
#nullable disable
[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>>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"17e165cd546d9b403ea75a1b085b72fcd2359e67", @"/Views/Medicine/AddIngredints.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_AddIngredints : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<IngredientModel>>
{
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);
......@@ -75,9 +82,9 @@ using System;
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
WriteLiteral("<section class=\"page-section p-5 m-5\">\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "73fb231ac798781ebdb3a7811abecbb78ae062d45220", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "17e165cd546d9b403ea75a1b085b72fcd2359e675412", 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, "73fb231ac798781ebdb3a7811abecbb78ae062d45707", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("select", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "17e165cd546d9b403ea75a1b085b72fcd2359e675899", async() => {
WriteLiteral("\r\n");
#nullable restore
#line 15 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
......@@ -88,7 +95,7 @@ using System;
#line hidden
#nullable disable
WriteLiteral(" ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "73fb231ac798781ebdb3a7811abecbb78ae062d46246", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "17e165cd546d9b403ea75a1b085b72fcd2359e676438", async() => {
#nullable restore
#line 17 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
Write(i.Name);
......@@ -149,10 +156,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=\"", 678, "\"", 705, 1);
BeginWriteAttribute("value", " value=\"", 683, "\"", 710, 1);
#nullable restore
#line 25 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
WriteAttributeValue("", 686, ViewBag.MedicineId, 686, 19, false);
WriteAttributeValue("", 691, ViewBag.MedicineId, 691, 19, false);
#line default
#line hidden
......@@ -189,7 +196,7 @@ WriteAttributeValue("", 686, ViewBag.MedicineId, 686, 19, false);
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<IEnumerable<Ingredient>> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<IEnumerable<IngredientModel>> Html { get; private set; }
}
}
#pragma warning restore 1591
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "f788f576b936745fdd89e96ae1c758f67e6a9237"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Delete.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6645dec332594b6d383843d6368f2ab2cb3542b3"
// <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")]
......@@ -27,21 +27,28 @@ using WebPresentation.Models;
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
#line 6 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"f788f576b936745fdd89e96ae1c758f67e6a9237", @"/Views/Medicine/Delete.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"e6fffd8dfe80957a1cbddaf47a216a7c128d6cf7", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_Delete : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<Medicine>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"6645dec332594b6d383843d6368f2ab2cb3542b3", @"/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>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "hidden", 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("asp-action", "Index", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
......@@ -150,9 +157,9 @@ using System;
#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, "f788f576b936745fdd89e96ae1c758f67e6a92377661", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6645dec332594b6d383843d6368f2ab2cb3542b37853", async() => {
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "f788f576b936745fdd89e96ae1c758f67e6a92377927", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "6645dec332594b6d383843d6368f2ab2cb3542b38119", async() => {
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper>();
......@@ -175,7 +182,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, "f788f576b936745fdd89e96ae1c758f67e6a92379707", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6645dec332594b6d383843d6368f2ab2cb3542b39899", async() => {
WriteLiteral("Back to List");
}
);
......@@ -218,7 +225,7 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_InputTagHelper.For = ModelExpressionProvid
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<Medicine> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<MedicineModel> Html { get; private set; }
}
}
#pragma warning restore 1591
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "63facbc62168b42781e47ea83818a4a99b4a97d4"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a0b8f91359c054a5cd6b2f5dcc36f9d31b4e146f"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_Details), @"mvc.1.0.view", @"/Views/Medicine/Details.cshtml")]
......@@ -27,21 +27,28 @@ using WebPresentation.Models;
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
#line 6 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"63facbc62168b42781e47ea83818a4a99b4a97d4", @"/Views/Medicine/Details.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"e6fffd8dfe80957a1cbddaf47a216a7c128d6cf7", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<Medicine>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"a0b8f91359c054a5cd6b2f5dcc36f9d31b4e146f", @"/Views/Medicine/Details.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MedicineModel>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("alt", new global::Microsoft.AspNetCore.Html.HtmlString("Avatar"), 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("img-fluid my-5"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
......@@ -96,16 +103,16 @@ using System;
<div class=""col-md-4 gradient-custom text-center text-black""
style=""border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;"">
");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "63facbc62168b42781e47ea83818a4a99b4a97d46672", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "a0b8f91359c054a5cd6b2f5dcc36f9d31b4e146f6864", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "src", 2, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
AddHtmlAttributeValue("", 669, "~/img/portfolio/", 669, 16, true);
AddHtmlAttributeValue("", 674, "~/img/portfolio/", 674, 16, true);
#nullable restore
#line 17 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Details.cshtml"
AddHtmlAttributeValue("", 685, Model.Image, 685, 12, false);
AddHtmlAttributeValue("", 690, Model.Image, 690, 12, false);
#line default
#line hidden
......@@ -138,7 +145,7 @@ AddHtmlAttributeValue("", 685, Model.Image, 685, 12, false);
#line hidden
#nullable disable
WriteLiteral("</p>\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "63facbc62168b42781e47ea83818a4a99b4a97d49028", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a0b8f91359c054a5cd6b2f5dcc36f9d31b4e146f9220", async() => {
WriteLiteral("\r\n <i class=\"far fa-edit mb-5\"></i>\r\n ");
}
);
......@@ -169,7 +176,7 @@ AddHtmlAttributeValue("", 685, Model.Image, 685, 12, false);
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "63facbc62168b42781e47ea83818a4a99b4a97d411313", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a0b8f91359c054a5cd6b2f5dcc36f9d31b4e146f11505", async() => {
WriteLiteral("\r\n\r\n <i class=\"far fa-backward\">\r\n\r\n </i>\r\n Go Back\r\n ");
}
);
......@@ -288,7 +295,7 @@ AddHtmlAttributeValue("", 685, Model.Image, 685, 12, false);
<div class=""col-6 mb-3"">
<h6>Go To list </h6>
");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "63facbc62168b42781e47ea83818a4a99b4a97d417380", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a0b8f91359c054a5cd6b2f5dcc36f9d31b4e146f17572", async() => {
WriteLiteral("Back to List");
}
);
......@@ -304,7 +311,7 @@ AddHtmlAttributeValue("", 685, Model.Image, 685, 12, false);
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n\r\n </div>\r\n <div class=\"col-6 mb-3\">\r\n <h6>Add Ingredient </h6>\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "63facbc62168b42781e47ea83818a4a99b4a97d418766", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a0b8f91359c054a5cd6b2f5dcc36f9d31b4e146f18958", async() => {
WriteLiteral("Add ");
}
);
......@@ -361,7 +368,7 @@ AddHtmlAttributeValue("", 685, Model.Image, 685, 12, false);
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<Medicine> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<MedicineModel> Html { get; private set; }
}
}
#pragma warning restore 1591
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