Commit b458f569 authored by hasan khaddour's avatar hasan khaddour

fix s

parent 36847cf6
......@@ -53,7 +53,7 @@ namespace API.Controllers
if (result.Succeeded)
{
await _signInManager.SignInAsync(user, isPersistent: false);
PatientModel p =await _patientSerivce.GetByUserEmail(Input.Email);
PatientDTO p =await _patientSerivce.GetByUserEmail(Input.Email);
return Ok(new {patient =p});
}
......@@ -75,7 +75,7 @@ namespace API.Controllers
if (result.Succeeded)
{
PatientModel p = await _patientSerivce.GetByUserEmail(model.Email);
PatientDTO p = await _patientSerivce.GetByUserEmail(model.Email);
return Ok(new
{
......
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationCore.Interfaces;
using ApplicationDomain.Entities;
using Microsoft.AspNetCore.Identity;
......@@ -10,7 +10,7 @@ namespace API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class CrudController<TModel> : BaseController where TModel : DomainBase
public class CrudController<TModel> : BaseController where TModel : DTOBase
{
protected readonly IService<TModel> _service;
......
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationCore.Interfaces.IServices;
using ApplicationDomain.Entities;
using Microsoft.AspNetCore.Authorization;
......@@ -15,7 +15,7 @@ namespace API.Controllers
[Route("api/[controller]")]
[ApiController]
[AllowAnonymous]
public class MedicalStateController : CrudController<MedicalStateModel>
public class MedicalStateController : CrudController<MedicalStateDTO>
{
private readonly IPatientService _patientService;
......
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationCore.Interfaces.IServices;
using ApplicationDomain.Entities;
using Microsoft.AspNetCore.Http;
......@@ -13,7 +13,7 @@ namespace API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class MedicineController : CrudController<MedicineModel>
public class MedicineController : CrudController<MedicineDTO>
{
public MedicineController(
IMedicineService medicalstateService,
......@@ -28,7 +28,7 @@ namespace API.Controllers
{
try
{
((IMedicineService)_service).AddToMedicalState(new MedicalStateMedicineModel { MedicalStateId = id, MedicineId = med });
((IMedicineService)_service).AddToMedicalState(new MedicalStateMedicineDTO { MedicalStateId = id, MedicineId = med });
return Ok(new {message= "Added"});
}
......@@ -42,7 +42,7 @@ namespace API.Controllers
[HttpPost("RemoveMedicineJ")]
public IActionResult RemoveMedicineJ(int id, int med)
{
((IMedicineService)_service).RemoveFromMedicalState(new MedicalStateMedicineModel { MedicalStateId = id, MedicineId = med });
((IMedicineService)_service).RemoveFromMedicalState(new MedicalStateMedicineDTO { MedicalStateId = id, MedicineId = med });
return Ok(new { message = "REmoved" });
}
......

namespace ApplicationCore.DTOs
{
public class DTOBase
{
public int Id { get; set; }
}
}
......@@ -4,12 +4,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
namespace ApplicationCore.DTOs
{
public class CategoryModel : DomainBase
public class IngredientDTO : DTOBase
{
public String Name { get; set; }
// public ICollection<MedicineModel> Medicines { get; set; }
public String Description { get; set; }
}
}
......@@ -4,15 +4,15 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
namespace ApplicationCore.DTOs
{
public class MedicineIngredientModel : DomainBase
public class MedicineIngredientDTO : DTOBase
{
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; }
public MedicineDTO Medicine { get; set; }
public IngredientDTO Ingredient { get; set; }
}
}
......@@ -4,17 +4,15 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
namespace ApplicationCore.DTOs
{
public class MedicalStateModel : DomainBase
public class MedicalStateDTO : DTOBase
{
public int PatientId { 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; }
public ICollection<MedicineDTO> Medicines { get; set; }
}
}
......@@ -4,18 +4,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
namespace ApplicationCore.DTOs
{
public class MedicalStateMedicineModel : DomainBase
public class MedicalStateMedicineDTO : DTOBase
{
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 ApplicationDomain.Entities;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
namespace ApplicationCore.DTOs
{
public class DomainBase
public class CategoryDTO : DTOBase
{
public int Id { get; set; }
public String Name { get; set; }
}
}
......@@ -5,9 +5,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
namespace ApplicationCore.DTOs
{
public class MedicineModel : DomainBase
public class MedicineDTO : DTOBase
{
public String TradeName { get; set; }
......@@ -18,12 +18,10 @@ namespace ApplicationCore.DomainModel
public int Price { get; set; }
public String Image { get; set; }
public int Dosage { 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; }
public CategoryDTO Category { get; set; }
public MedicineTypeDTO MedicineType { get; set; }
public ICollection<IngredientDTO> Ingredients { get; set; }
public ICollection<MedicineIngredientDTO> MedicineIngredients { get; set; }
}
}
......@@ -4,11 +4,10 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
namespace ApplicationCore.DTOs
{
public class MedicineTypeModel : DomainBase
public class MedicineTypeDTO : DTOBase
{
public String TypeName { get; set; }
// public ICollection<MedicineModel> Medicines { get; set; }
}
}
......@@ -5,9 +5,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.DomainModel
namespace ApplicationCore.DTOs
{
public class PatientModel : DomainBase
public class PatientDTO : DTOBase
{
......@@ -15,10 +15,6 @@ namespace ApplicationCore.DomainModel
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
public ICollection<MedicalStateDTO> MedicalStates { 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 ApplicationCore.DTOs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Interfaces
{
public interface IService<T> where T : class
public interface IService<T> where T : DTOBase
{
public Task<IEnumerable<T>> GetAll();
public Task<T> GetDetails(int Id);
public Task<IEnumerable<T>> GetByCriteria(Func<T,bool> Cretira);
public Task<T> GetDetails(int Id);
public void Delete(int Id);
public T Update(T tModel);
public T Create(T tModel);
......
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using System;
using ApplicationCore.DTOs;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IIngredientService : IService<IngredientModel>
public interface IIngredientService : IService<IngredientDTO>
{
public Task<MedicineIngredientModel> AddToMedicine(MedicineIngredientModel medicineIngredientModel);
public Task RemoveFromMedicine(MedicineIngredientModel medicineIngredientModel);
public Task AddToMedicine(MedicineIngredientDTO medicineIngredientDto);
public Task RemoveFromMedicine(MedicineIngredientDTO medicineIngredientDto);
}
}
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using System;
using ApplicationCore.DTOs;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IMedicalStateService : IService<MedicalStateModel>
public interface IMedicalStateService : IService<MedicalStateDTO>
{
public Task<IEnumerable<MedicalStateModel>> GetAllPatientMedicalStates(int patientId);
public MedicalStateModel AddToPateint(int patientId , MedicalStateModel medicalState);
public Task<IEnumerable<MedicalStateDTO>> GetAllPatientMedicalStates(int patientId);
public MedicalStateDTO AddToPateint(int patientId , MedicalStateDTO medicalState);
}
......
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using System;
using ApplicationCore.DTOs;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IMedicineService :IService<MedicineModel>
public interface IMedicineService :IService<MedicineDTO>
{
public MedicineModel GetMedicineIngredentisDetails(int medicineId);
public void AddToMedicalState(MedicalStateMedicineModel medicalStateMedicineModel);
public void RemoveFromMedicalState(MedicalStateMedicineModel medicalStateMedicineModel);
public MedicineDTO GetMedicineIngredentisDetails(int medicineId);
public void AddToMedicalState(MedicalStateMedicineDTO medicalStateMedicineModel);
public void RemoveFromMedicalState(MedicalStateMedicineDTO medicalStateMedicineModel);
public Task<IEnumerable<MedicineIngredientDTO>> GetMedicineIngredients( int id);
}
}
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
using ApplicationCore.DTOs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices
{
public interface IPatientService :IService<PatientModel>
public interface IPatientService :IService<PatientDTO>
{
public Task<IEnumerable<MedicalStateModel>> GetPatientMedicalStates(int patientId);
public Task<MedicalStateModel> GetMedicalStateDetails(int id);
public Task<PatientModel> GetByUserEmail(String email );
public Task<PatientModel> GetByUserId(String email);
public Task<IEnumerable<MedicalStateDTO>> GetPatientMedicalStates(int patientId);
public Task<MedicalStateDTO> GetMedicalStateDetails(int id);
public Task<PatientDTO> GetByUserEmail(String email );
public Task<PatientDTO> GetByUserId(String email);
// public Task<IEnumerable<PatientModel>>GetAll();
public void AddMedicalState(int patientId, MedicalStateModel medicalState);
public void AddMedicalState(int patientId, MedicalStateDTO medicalState);
// public Patient GetDetails(int id);
// public void Insert(PatientModel patient);
// public void Update(Patient patient);
......
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationDomain.Entities;
using AutoMapper;
using System;
using System.Linq.Expressions;
namespace ApplicationCore.Mapper
{
......@@ -10,13 +10,13 @@ namespace ApplicationCore.Mapper
{
public ObjectMapper() {
CreateMap<Medicine, MedicineModel>()
CreateMap<Medicine, MedicineDTO>()
.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>()
CreateMap<MedicineDTO, 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))
......@@ -24,30 +24,30 @@ namespace ApplicationCore.Mapper
.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>()
CreateMap<PatientDTO, Patient>().ReverseMap();
CreateMap<Patient, PatientDTO>().ReverseMap();
CreateMap<Ingredient, IngredientDTO>().ReverseMap();
CreateMap<MedicalState, MedicalStateDTO>()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
// .ForMember(dest => dest.Patient, opt => opt.MapFrom(src => src.Patient))
.ForMember(dest => dest.Medicines, opt => opt.MapFrom(src => src.Medicines));
;
CreateMap<MedicalStateModel, MedicalState>()
CreateMap<MedicalStateDTO, MedicalState>()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
// .ForMember(dest => dest.Patient, opt => opt.MapFrom(src => src.Patient))
.ForMember(dest => dest.Medicines, opt => opt.MapFrom(src => src.Medicines))
.ForMember(s=>s.MedicalStateMedicines , op=>op.Ignore())
.ForMember(s => s.Patient, op => op.Ignore());
CreateMap<Category, CategoryModel>();
CreateMap<CategoryModel, Category>()
CreateMap<Category, Category>();
CreateMap<Category, Category>()
.ForMember(dest => dest.Medicines, opt => opt.Ignore())
;
CreateMap<MedicineType, MedicineTypeModel>().ReverseMap();
CreateMap<MedicineType, MedicineTypeDTO>().ReverseMap();
CreateMap<MedicalStateMedicine, MedicalStateMedicineModel>().ReverseMap();
CreateMap<MedicalStateMedicine, MedicalStateMedicineDTO>().ReverseMap();
}
}
}
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationCore.Interfaces;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Exceptions;
......@@ -6,15 +6,13 @@ using ApplicationDomain.Entities;
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationCore.Services
{
public class ServiceBase<TEntity,TModel> : IService<TModel> where TEntity : EntityBase where TModel : DomainBase
public class ServiceBase<TEntity,TDto> : IService<TDto> where TEntity : EntityBase where TDto : DTOBase
{
protected readonly IMapper _mapper;
protected IMapper _mapper;
protected readonly IUnitOfWork<TEntity> _unitOfWork;
protected ISpecification<TEntity> _specification;
......@@ -29,30 +27,30 @@ namespace ApplicationCore.Services
_mapper = mapper;
}
public async Task<IEnumerable<TModel>> GetAll()
public async Task<IEnumerable<TDto>> GetAll()
{
var r = await _unitOfWork.Entity.GetAll(
_specification
);
return _mapper.Map<IEnumerable<TModel>>(r);
return _mapper.Map<IEnumerable<TDto>>(r);
}
public TModel Create(TModel model )
public TDto Create(TDto model )
{
TEntity entity = _unitOfWork.Entity.Insert(_mapper.Map<TEntity>(model));
_unitOfWork.Commit();
return _mapper.Map<TModel>(entity);
return _mapper.Map<TDto>(entity);
}
public TModel Update(TModel model)
public TDto Update(TDto model)
{
TEntity entity = _unitOfWork.Entity.Update(_mapper.Map<TEntity>(model));
_unitOfWork.Commit();
return _mapper.Map<TModel>(entity);
return _mapper.Map<TDto>(entity);
}
public async Task<TModel> GetDetails(int id)
public async Task<TDto> GetDetails(int id)
{
var model = await _unitOfWork.Entity.GetById(id,
......@@ -60,7 +58,7 @@ namespace ApplicationCore.Services
if (model is null) {
throw new NotFoundException();
}
return _mapper.Map<TModel>(model);
return _mapper.Map<TDto>(model);
}
......@@ -70,6 +68,28 @@ namespace ApplicationCore.Services
_unitOfWork.Commit();
}
public async Task<IEnumerable<TDto>> GetByCriteria(Func<TDto, bool> Cretira)
{
Func<TEntity, bool> t = MapFunc(Cretira);
var ol = _specification.Criteria;
_specification.Criteria = expr =>t.Invoke(expr);
var result =await _unitOfWork.Entity.GetAll(_specification);
_specification.Criteria = ol;
return _mapper.Map<IEnumerable<TDto>>(result);
}
public Func<EntityBase, bool> MapFunc(Func<TDto, bool> dtoFunc)
{
return entity =>
{
// Map the EntityBase instance to a DTO instance
var dto = _mapper.Map<TDto>(entity);
// Invoke the original function on the mapped DTO
return dtoFunc(dto);
};
}
}
}
......@@ -3,17 +3,15 @@ using ApplicationCore.Interfaces;
using ApplicationCore.Interfaces.IServices;
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 ApplicationCore.DTOs;
using AutoMapper;
using System.Collections.Generic;
namespace ApplicationCore.Services
{
public class IngredientService : ServiceBase<Ingredient,IngredientModel> , IIngredientService
public class IngredientService : ServiceBase<Ingredient,IngredientDTO> , IIngredientService
{
public IngredientService(
IUnitOfWork<Ingredient> unitOfWork,
......@@ -24,22 +22,23 @@ namespace ApplicationCore.Services
}
public async Task<MedicineIngredientModel> AddToMedicine(MedicineIngredientModel medicineIngredientModel) {
var medicine = await _unitOfWork.Entity.GetById(medicineIngredientModel.IngredientId,_specification);
MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientModel);
public async Task AddToMedicine(MedicineIngredientDTO medicineIngredientDto) {
var medicine = await _unitOfWork.Entity.GetById(medicineIngredientDto.IngredientId,_specification);
MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientDto);
medicine.MedicineIngredients.Add(
medicineIngredient
);
_unitOfWork.Entity.Update(medicine);
_unitOfWork.Commit();
return medicineIngredientModel;
}
public async Task RemoveFromMedicine(MedicineIngredientModel medicineIngredientModel)
public async Task RemoveFromMedicine(MedicineIngredientDTO medicineIngredientDto)
{
var ingredient = await _unitOfWork.Ingredients.GetById(medicineIngredientModel.IngredientId, _specification);
var ingredient = await _unitOfWork.Ingredients.GetById(medicineIngredientDto.IngredientId, _specification);
MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientModel);
var m =ingredient.MedicineIngredients.Where(p => p.MedicineId == medicineIngredientModel.MedicineId).FirstOrDefault();
MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientDto);
var m =ingredient.MedicineIngredients.Where(p => p.MedicineId == medicineIngredientDto.MedicineId).FirstOrDefault();
ingredient.MedicineIngredients.Remove(m);
_unitOfWork.Entity.Update(ingredient);
......
......@@ -4,12 +4,12 @@ using ApplicationCore.Interfaces.IServices;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification;
using AutoMapper;
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using System.Threading.Tasks;
namespace ApplicationCore.Services
{
public class MedicalStateService :ServiceBase<MedicalState ,MedicalStateModel>, IMedicalStateService
public class MedicalStateService :ServiceBase<MedicalState ,MedicalStateDTO>, IMedicalStateService
{
public MedicalStateService(
......@@ -18,23 +18,23 @@ namespace ApplicationCore.Services
):base(unitOfWork,Mapper)
{
_specification = new MedicalStateWithMedicinesSpecification();
}
public MedicalStateModel AddToPateint(int patientId , MedicalStateModel medicalStateModel)
public MedicalStateDTO AddToPateint(int patientId , MedicalStateDTO medicalStateDto)
{
medicalStateModel.PatientId = patientId;
medicalStateDto.PatientId = patientId;
var im =medicalStateModel;
var im = medicalStateDto;
var r = _unitOfWork.Entity.Insert(_mapper.Map<MedicalState>(im));
_unitOfWork.Commit();
return _mapper.Map<MedicalStateModel>(r);
return _mapper.Map<MedicalStateDTO>(r);
}
public async Task<IEnumerable<MedicalStateModel>> GetAllPatientMedicalStates(int patientId)
public async Task<IEnumerable<MedicalStateDTO>> GetAllPatientMedicalStates(int patientId)
{
return _mapper.Map<IEnumerable<MedicalStateModel>>(
return _mapper.Map<IEnumerable<MedicalStateDTO>>(
await _unitOfWork.MedicalStates.GetByPatient(patientId, _specification)
......
......@@ -4,11 +4,13 @@ using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification;
using System.Collections.Generic;
using AutoMapper;
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationDomain.Exceptions;
using System.Threading.Tasks;
namespace ApplicationCore.Services
{
public class MedicineService : ServiceBase<Medicine,MedicineModel>,IMedicineService
public class MedicineService : ServiceBase<Medicine,MedicineDTO>,IMedicineService
{
private MedicalStateWithMedicinesSpecification _medicalSpecification;
......@@ -23,46 +25,57 @@ namespace ApplicationCore.Services
public void AddToMedicalState(MedicalStateMedicineModel medicalStateMedicineModel)
public void AddToMedicalState(MedicalStateMedicineDTO medicalStateMedicineDto)
{
var medicine = _unitOfWork.Entity.GetById(medicalStateMedicineModel.MedicineId, _specification).Result;
//if (medicalState.Medicines is null)
// medicalState.Medicines = new List<Medicine>();
//var medicine = await _medicineUnitOfWork.Entity.GetById(medicalStateMedicineModel.MedicineId, _medicineSpecification);
if (medicine.MedicalStateMedicines is null)
medicine.MedicalStateMedicines = new List<MedicalStateMedicine>();
medicine.MedicalStateMedicines.Add(
_mapper.Map<MedicalStateMedicine>( medicalStateMedicineModel
var medicalState = _unitOfWork.Entity.GetById(medicalStateMedicineDto.MedicineId, _specification).Result;
if (medicalState.MedicalStateMedicines is null)
medicalState.MedicalStateMedicines = new List<MedicalStateMedicine>();
foreach (var i in medicalState.MedicalStateMedicines)
{
if (
i.MedicalStateId == medicalStateMedicineDto.MedicalStateId
&&
i.MedicineId == medicalStateMedicineDto.MedicineId
)
throw new DomainException("the medicine already exist ");
}
if (medicalState.MedicalStateMedicines is null)
medicalState.MedicalStateMedicines = new List<MedicalStateMedicine>();
medicalState.MedicalStateMedicines.Add(
_mapper.Map<MedicalStateMedicine>(medicalStateMedicineDto
)
);
_unitOfWork.Entity.Update(medicine);
_unitOfWork.Entity.Update(medicalState);
_unitOfWork.Commit();
}
public void RemoveFromMedicalState(MedicalStateMedicineModel medicalStateMedicineModel)
public void RemoveFromMedicalState(MedicalStateMedicineDTO medicalStateMedicineDto)
{
var m = _unitOfWork.MedicalStates.GetById(medicalStateMedicineModel.MedicalStateId, _medicalSpecification).Result;
//// throw an exception
//if (m.Medicines is null)
// m.Medicines = new List<Medicine>();
var d = _unitOfWork.Entity.GetById(medicalStateMedicineModel.MedicineId, _specification).Result;
m.Medicines.Remove(d);
_unitOfWork.MedicalStates.Update(m);
var medicalState = _unitOfWork.MedicalStates.GetById(medicalStateMedicineDto.MedicalStateId, _medicalSpecification).Result;
if (medicalState.MedicalStateMedicines is null)
throw new DomainException("you dont have this medicine");
var d = _unitOfWork.Entity.GetById(medicalStateMedicineDto.MedicineId, _specification).Result;
if(! medicalState.Medicines.Remove(d))
throw new DomainException("you dont have this medicine");
_unitOfWork.MedicalStates.Update(medicalState);
_unitOfWork.Commit();
}
public MedicineModel GetMedicineIngredentisDetails(int medicineId) {
public MedicineDTO GetMedicineIngredentisDetails(int medicineId) {
return _mapper.Map<MedicineModel>(_unitOfWork.Entity
return _mapper.Map<MedicineDTO>(_unitOfWork.Entity
.GetById(medicineId ,
_specification));
}
public async Task<IEnumerable<MedicineIngredientDTO>> GetMedicineIngredients(int id)
{
var r = await _unitOfWork.Medicines.GetById(id,_specification);
return _mapper.Map<IEnumerable<MedicineIngredientDTO>>( r.Ingredients);
}
}
}
......@@ -10,11 +10,11 @@ using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
namespace ApplicationCore.Services
{
public class PatientService : ServiceBase<Patient ,PatientModel> , IPatientService
public class PatientService : ServiceBase<Patient ,PatientDTO> , IPatientService
{
private MedicalStateWithMedicinesSpecification _medicalStateSpecification;
......@@ -27,10 +27,10 @@ namespace ApplicationCore.Services
_medicalStateSpecification = new MedicalStateWithMedicinesSpecification();
}
public async Task<IEnumerable<MedicalStateModel>> GetPatientMedicalStates(int patientId) {
public async Task<IEnumerable<MedicalStateDTO>> GetPatientMedicalStates(int patientId) {
return _mapper.Map<IEnumerable<MedicalStateModel>>(
return _mapper.Map<IEnumerable<MedicalStateDTO>>(
await _unitOfWork.MedicalStates
.GetByPatient(
patientId, _medicalStateSpecification
......@@ -38,14 +38,14 @@ namespace ApplicationCore.Services
}
public async Task< MedicalStateModel> GetMedicalStateDetails(int id)
public async Task< MedicalStateDTO> GetMedicalStateDetails(int id)
{
return _mapper.Map<MedicalStateModel>(await _unitOfWork.MedicalStates.GetById(id,_medicalStateSpecification));
return _mapper.Map<MedicalStateDTO>(await _unitOfWork.MedicalStates.GetById(id,_medicalStateSpecification));
}
public void AddMedicalState (int patientId, MedicalStateModel medicalState) {
public void AddMedicalState (int patientId, MedicalStateDTO medicalState) {
var ptient = _unitOfWork.Entity.GetById(patientId,_specification).Result;
......@@ -60,16 +60,16 @@ namespace ApplicationCore.Services
return _unitOfWork.Entity.GetById(id) is null ? false : true;
}
public async Task<PatientModel> GetByUserEmail(string email)
public async Task<PatientDTO> GetByUserEmail(string email)
{
var ps = await _unitOfWork.Entity.GetAll(_specification);
return _mapper.Map<PatientModel>(ps.Where(p => p.User.Email == email).FirstOrDefault());
return _mapper.Map<PatientDTO>(ps.Where(p => p.User.Email == email).FirstOrDefault());
}
public async Task<PatientModel> GetByUserId(string id)
public async Task<PatientDTO> GetByUserId(string id)
{
var ps = await _unitOfWork.Entity.GetAll(_specification);
return _mapper.Map<PatientModel>(ps.Where(p => p.User.Id == id).FirstOrDefault());
return _mapper.Map<PatientDTO>(ps.Where(p => p.User.Id == id).FirstOrDefault());
}
}
......
......@@ -8,12 +8,12 @@ namespace ApplicationDomain.Exceptions
{
public class DomainException : Exception
{
internal DomainException(string businessMessage)
public DomainException(string businessMessage)
: base(businessMessage)
{
}
internal DomainException(string message, Exception innerException)
public DomainException(string message, Exception innerException)
: base(message, innerException)
{
}
......
......@@ -5,8 +5,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
namespace WebPresentation.Controllers
{
......
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationCore.Interfaces;
using ApplicationDomain.Entities;
using AutoMapper;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace WebPresentation.Controllers
{
public class CRUDController<T> : BaseController where T : DomainBase
public class CRUDController<TDto,TVModel> : BaseController where TDto : DTOBase where TVModel : ViewModels.BaseViewModel
{
protected readonly IService<T> _service;
protected readonly IMapper _mapper;
protected readonly IService<TDto> _service;
protected Func<TDto, bool> Criteria;
public CRUDController(
UserManager<User> userManager,
IService<T> service
IService<TDto> service,
IMapper mapper
)
:base(userManager)
{
_mapper = mapper;
_service = service;
}
public IActionResult Dummy(int id)
public async virtual Task<IActionResult> Index()
{
var DetailDto = await _service.GetAll();
IEnumerable<TVModel> model = _mapper.Map<IEnumerable<TVModel>>(DetailDto);
return View(model);
}
public IActionResult DummyPartial(int id)
{
return PartialView(id);
}
// Post method to edit a medicine
[HttpPost]
public IActionResult Dummy(int id, string s)
public IActionResult DummyPartial(int id, string s)
{
return RedirectToAction(nameof(Details),new { Id= id});
}
......@@ -39,77 +54,78 @@ namespace WebPresentation.Controllers
if (id is null)
{
return View("NotFound");
return PartialView("_PartialNotFound");
}
else
{
T TModel = await _service.GetDetails((int)id);
if (TModel is null)
return View("NotFound");
return View(TModel);
TDto DetailDto = await _service.GetDetails((int)id);
if (DetailDto is null)
return PartialView("_PartialNotFound");
TVModel model = _mapper.Map<TVModel>(DetailDto);
return View(model);
}
}
public async Task< IActionResult> Delete(int id)
{
var TModel = await _service.GetDetails(id);
TDto DetailDto = await _service.GetDetails(id);
if (TModel == null)
if (DetailDto == null)
{
return View("NotFound");
}
return PartialView(TModel);
TVModel model = _mapper.Map<TVModel>(DetailDto);
return PartialView(model);
}
public async virtual Task<IActionResult> Index()
{
var s = await _service.GetAll();
return View(s);
}
[HttpPost, ActionName("Delete")]
// [ValidateAntiForgeryToken]
public IActionResult DeleteConfirmed(int id)
{
_service.Delete(id);
return RedirectToAction("Index");
}
// GET: Projects/Edit/5
public IActionResult Edit(int? id)
[HttpGet]
public async Task<IActionResult> Edit(int? id)
{
if (id == null)
{
return View("NotFound");
return PartialView("_PartialNotFound");
}
T tModel = _service.GetDetails((int)id).Result;
if (tModel == null)
try
{
return View("NotFound");
TDto tModel = await _service.GetDetails((int)id);
if (tModel == null)
{
return PartialView("_PartialNotFound");
}
TVModel model = _mapper.Map<TVModel>(tModel);
return PartialView(model);
}
catch {
return PartialView("PartialNotFound");
}
return PartialView(tModel);
}
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Edit(int id, T tModel)
public IActionResult Edit(int id, TVModel viewModel)
{
if (id != tModel.Id)
if (id != viewModel.Id)
{
return NotFound();
}
TDto dto = null;
if (ModelState.IsValid)
{
try
{
tModel = _service.Update(tModel);
dto = _mapper.Map<TDto>(viewModel);
dto = _service.Update(dto);
}
catch (DbUpdateConcurrencyException)
......@@ -117,9 +133,11 @@ namespace WebPresentation.Controllers
return View("Error");
}
return RedirectToAction("Details",new { id=tModel.Id});
return RedirectToAction("Details",new { id=dto.Id});
}
return PartialView(tModel);
TVModel model = _mapper.Map<TVModel>(dto);
return PartialView(model);
}
public IActionResult Create()
......@@ -127,22 +145,53 @@ namespace WebPresentation.Controllers
return View();
}
// POST: Projects/Create
// To protect from overposting attacks, enable the specific properties you want to bind to.
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public virtual IActionResult Create(T viewModel, int id)
public virtual IActionResult Create(TVModel viewModel, int id)
{
if (ModelState.IsValid)
{
viewModel= _service.Create(viewModel);
TDto dto = _mapper.Map<TDto>(viewModel);
dto= _service.Create(dto);
viewModel = _mapper.Map<TVModel>(dto);
return RedirectToAction("Details", new { id = viewModel.Id });
}
return View(viewModel);
}
#region json format
[HttpGet]
public virtual async Task<IActionResult> GetDetails(int? id)
{
if (id is null)
{
return Ok(new { message= "No ID Provided" , result= "Faild" });
}
else
{
TDto model = await _service.GetDetails((int)id);
if (model is null)
return Ok(new { message = "No Data Found ", result = "Faild" });
return Ok(new { message = "Succed", result = model });
}
}
[HttpGet]
public virtual async Task<IActionResult> GetALL()
{
var all = await _service.GetAll();
return Ok(new { message = "Succed", result = all });
}
#endregion json format
}
}
......@@ -2,15 +2,14 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using WebPresentation.Models;
using ApplicationCore.Interfaces.IServices;
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using AutoMapper;
using WebPresentation.ViewModels;
using System.Threading.Tasks;
namespace WebPresentation.Controllers
{
......@@ -18,41 +17,36 @@ namespace WebPresentation.Controllers
[Authorize(Roles ="patient")]
public class HomeController : BaseController
{
private readonly IMapper _mapper;
private readonly IPatientService _patientService;
public HomeController(
UserManager<User> userManager,
IPatientService patientService
IPatientService patientService,
IMapper mapper
):base(userManager)
{
_mapper = mapper;
_patientService = patientService;
}
private PatientModel _getCurrentPatient() {
var u = GetCurrentUser();
var userId = GetUserId();
private async Task<PatientViewModel> getCurrentPatient() {
var patient = _patientService
.GetAll(
).Result
.Where(
u => u.User.Id == userId
)
.FirstOrDefault();
return patient;
var userId = GetUserId();
var patient =await _patientService.GetByUserId(userId);
return _mapper.Map<PatientViewModel>(patient);
}
public IActionResult Index()
public async Task<IActionResult> Index()
{
return View(_getCurrentPatient());
var t =await getCurrentPatient();
return View(t);
}
public IActionResult Details(int? id ) {
return View(_getCurrentPatient());
return View(getCurrentPatient());
}
......
......@@ -2,31 +2,26 @@
using ApplicationCore.Interfaces.IServices;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authorization;
using ApplicationCore.DomainModel;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using ApplicationCore.DTOs;
using WebPresentation.ViewModels;
using AutoMapper;
namespace WebPresentation.Controllers
{
[Authorize(Roles = "Admin")]
public class IngredientController : CRUDController<IngredientModel>
public class IngredientController : CRUDController<IngredientDTO,IngredientViewModel>
{
public IngredientController(UserManager<User> userManager,
IIngredientService ingredientSercie
) : base(userManager,ingredientSercie)
public IngredientController(
UserManager<User> userManager,
IIngredientService ingredientSercie,
IMapper mapper
) : base(userManager,ingredientSercie,mapper)
{
}
public async Task<IActionResult> GetIngredients()
{
var s = await _service.GetAll();
return Ok(s);
}
}
}
......@@ -3,18 +3,19 @@ using ApplicationCore.Interfaces.IServices;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using WebPresentation.ViewModels;
using AutoMapper;
using System.Collections.Generic;
using ApplicationDomain.Exceptions;
namespace WebPresentation.Controllers
{
[Authorize(Roles = "patient")]
public class MedicalStateController : CRUDController<MedicalStateModel>
public class MedicalStateController : CRUDController<MedicalStateDTO,MedicalStateViewModel>
{
private readonly IMedicalStateService _medicalStateService;
private readonly IPatientService _patientService;
......@@ -24,8 +25,9 @@ namespace WebPresentation.Controllers
public MedicalStateController(UserManager<User> userManager,
IMedicalStateService medicalStateService ,
IPatientService patientService ,
IMedicineService medicineService
) : base(userManager,medicalStateService)
IMedicineService medicineService,
IMapper mapper
) : base(userManager,medicalStateService,mapper)
{
_medicalStateService = medicalStateService;
_patientService =patientService;
......@@ -34,11 +36,13 @@ namespace WebPresentation.Controllers
public async override Task<IActionResult> Index( )
{
var u = GetUserId();
var p = await _patientService.GetAll();
var pId= p.Where(p => p.User.Id == u).FirstOrDefault().Id;
var meds =await ((IMedicalStateService )_service).GetAllPatientMedicalStates(pId);
return View(meds);
var u = GetUserId();
var p = await _patientService.GetByUserId(u);
var pId= p.Id;
var meds =await ((IMedicalStateService )_service).GetAllPatientMedicalStates(pId);
return View(_mapper.Map<IEnumerable<MedicalStateViewModel>>(meds));
}
......@@ -46,7 +50,7 @@ namespace WebPresentation.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
public override IActionResult Create(MedicalStateModel medicalState, int id)
public override IActionResult Create(MedicalStateViewModel medicalState, int id)
{
if (ModelState.IsValid)
{
......@@ -54,102 +58,93 @@ namespace WebPresentation.Controllers
var p = _patientService.GetByUserId(uId).Id;
if (medicalState.PrescriptionTime == DateTime.MinValue )
medicalState.PrescriptionTime = DateTime.Now;
var n= ((IMedicalStateService)_service).AddToPateint(p,medicalState);
var n= ((IMedicalStateService)_service).AddToPateint(p,_mapper.Map<MedicalStateDTO>(medicalState));
return RedirectToAction("Details", "MedicalState" , new { Id =n.Id });
}
return View(medicalState);
}
//[HttpGet]
//public IActionResult AddMedicine(int id)
//{
// var all = _medicineService.GetAll();
// ViewBag.MedicalStateId = id;
// return View(all);
//}
//[HttpPost]
//[ActionName("AddMedicine")]
//public IActionResult AddMedicineT(int id, int med)
//{
// _medicineService.AddToMedicalState(new MedicalStateMedicineModel{MedicalStateId=id ,MedicineId=med });
// return RedirectToAction("Details", "MedicalState", new { Id = id });
//}
//[ActionName("RemoveMedicine")]
//public IActionResult RemoveMedicinej(int id, int med)
//{
// _medicineService.RemoveFromMedicalState(new MedicalStateMedicineModel { MedicalStateId = id, MedicineId = med });
// return RedirectToAction("Details", "MedicalState", new { Id = id });
//}
#region json
[HttpGet]
public JsonResult GetMedicalStateMedicine(int id) {
public async Task<IActionResult> GetMedicalStateMedicine(int id) {
var r = _medicalStateService.GetDetails(id).Result.Medicines;
return Json(r);
var all = await _medicalStateService.GetDetails(id);
return Ok(new { message = "Succed", result = all.Medicines });
}
[HttpPost]
public JsonResult AddMedicine([FromBody]MedicalStateMedicineModel medicalStateMedicineModel)
public IActionResult AddMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
{
try
{
var medicalStateMedicineModel = _mapper.Map<MedicalStateMedicineDTO>(medicalStateMedicine);
_medicineService.AddToMedicalState(medicalStateMedicineModel);
return Json("Added");
return Ok(new { message = "Succed", result = "add" });
}
catch(DomainException e )
{
return NotFound(new { message = e.Message, result = "faild" });
}
catch
{
return Json("faild");
return NotFound(new { message = "Error ", result = "faild" });
}
}
[HttpPost]
public JsonResult RemoveMedicine([FromBody]MedicalStateMedicineModel medicalStateMedicineModel)
public IActionResult RemoveMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
{
_medicineService.RemoveFromMedicalState(medicalStateMedicineModel);
MedicalStateMedicineDTO medicalStateMedicineModel = _mapper.Map<MedicalStateMedicineDTO>(medicalStateMedicine);
try
{
_medicineService.RemoveFromMedicalState(medicalStateMedicineModel);
return Json("Reomved");
}
return Ok(new { message = "Succed", result = "removed" });
[Authorize(Roles = "patient")]
public async Task<JsonResult> GetDetails(int? id)
{
}
if (id is null)
catch (DomainException e)
{
return Json("");
return NotFound(new { message = e.Message, result = "faild" });
}
else
catch
{
MedicineModel TModel = await _medicineService.GetDetails((int)id);
if (TModel is null)
return Json("");
return Json(TModel);
return NotFound(new { message = "Error ", result = "faild" });
}
}
[Authorize(Roles = "patient")]
[HttpGet]
public JsonResult GetMedicines()
public async Task<IActionResult> GetALLMedicines()
{
var all = _medicineService.GetAll().Result;
return new JsonResult(all);
var all = await _medicineService.GetAll();
return Ok(new { message = "Succed", result = all });
}
public async Task<IActionResult> GetMedicineDetails(int? id )
{
if (id is null )
return Ok(new { message = "No ID Provided", result = "Faild" });
var all = await _medicineService.GetDetails((int)id);
if(all is null )
return NotFound(new { message = "No Data Found", result = "Faild" });
return Ok(new { message = "Succed", result = all });
}
#endregion json
}
......
using ApplicationDomain.Entities;
using ApplicationCore.Interfaces.IServices;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using System.Threading.Tasks;
using WebPresentation.ViewModels;
using AutoMapper;
namespace WebPresentation.Controllers
{
[Authorize(Roles = "Admin")]
public class MedicineController : CRUDController<MedicineModel>
public class MedicineController : CRUDController<MedicineDTO,MedicineViewModel>
{
private readonly IIngredientService _ingredientService;
public MedicineController(UserManager<User> userManager,
public MedicineController(
UserManager<User> userManager,
IMedicineService medicineService ,
IIngredientService ingredientService
IIngredientService ingredientService,
IMapper mapper
):base(userManager ,medicineService)
):base(userManager ,medicineService,mapper)
{
_ingredientService =ingredientService;
}
#region json
[Authorize(Roles = "Admin")]
[HttpPost]
public async Task<IActionResult> ReomveIngredient([FromBody] MedicineIngredientModel medicineIngredientModel)
public async Task<IActionResult> ReomveIngredient([FromBody] MedicineIngredientDTO medicineIngredientModel)
{
await _ingredientService.RemoveFromMedicine(medicineIngredientModel);
return Ok(new {message = "removed" });
return Ok(new {message = "removed" ,result ="Successed"});
}
[Authorize(Roles = "Admin")]
[HttpPost]
public async Task<IActionResult> AddIngredints([FromBody] MedicineIngredientModel medicineIngredientModel)
public async Task<IActionResult> AddIngredient([FromBody] MedicineIngredientDTO medicineIngredientModel)
{
await _ingredientService.AddToMedicine(medicineIngredientModel);
return Ok(new { message = "added"});
return Ok(new { message = "added", result = "Successed" });
}
public async Task<IActionResult> GetMedcineIngredient(int id) {
var r = await ((IMedicineService)_service).GetMedicineIngredients(id);
return Ok(new { message = "removed", result = r });
#region json
//[Authorize(Roles = "Admin")]
//public IActionResult AddIngredints(int id)
//{
// var s = _ingredientService.GetAll().Result;
// ViewBag.MedicineId = id;
// return View(s);
//}
//[Authorize(Roles = "Admin")]
//[HttpPost]
//public IActionResult AddIngredints(int id, int med, int ratio)
//{
// _ingredientService.AddToMedicine(new MedicineIngredientModel { Id = id, MedicineId = med, Ratio = ratio });
// return RedirectToAction("Details", "Medicine", new { Id = med });
//}
}
#endregion json
}
......
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationCore.Interfaces.IServices;
using ApplicationDomain.Entities;
using AutoMapper;
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 WebPresentation.ViewModel.Identity;
using WebPresentation.ViewModels;
namespace WebPresentation.Controllers
{
[Authorize(Roles ="Admin")]
public class PatientsController : CRUDController<PatientModel>
public class PatientsController : CRUDController<PatientDTO,PatientViewModel>
{
public PatientsController(UserManager<User> userManager,
IPatientService patientService
) : base(userManager, patientService)
public PatientsController(
UserManager<User> userManager,
IPatientService patientService,
IMapper mapper
) : base(userManager, patientService,mapper)
{
}
......
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationDomain.Entities;
using AutoMapper;
using WebPresentation.ViewModels;
......@@ -9,25 +9,20 @@ namespace ApplicationCore.Mappere
{
public ViewModelObjectMapper()
{
CreateMap<MedicineViewModel, 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, MedicineViewModel>()
.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.Name))
;
CreateMap<PatientModel, PatientViewModel>().ReverseMap();
CreateMap<MedicineViewModel, MedicineDTO>().ReverseMap();
CreateMap<PatientDTO, PatientViewModel>().ReverseMap();
CreateMap<Ingredient, IngredientModel>().ReverseMap();
CreateMap<MedicalStateViewModel, MedicalStateModel>().ReverseMap();
CreateMap<IngredientViewModel, IngredientDTO>().ReverseMap();
CreateMap<MedicineIngredientDTO, MedicineIngredientViewModel>().ReverseMap();
CreateMap<MedicalStateViewModel, MedicalStateDTO>().ReverseMap();
CreateMap<DomainBase, BaseViewModel>().ReverseMap();
CreateMap<DTOBase, BaseViewModel>().ReverseMap();
CreateMap<CategoryDTO, CategoryViewModel>().ReverseMap();
CreateMap<MedicineTypeDTO, MedicineTypeViewModel>().ReverseMap();
CreateMap<MedicalStateMedicineDTO, MedicalStateMedicineVModel>().ReverseMap();
}
}
......
......@@ -25,6 +25,7 @@ namespace WebPresentation.Midlewares
}
catch (Exception ex)
{
}
}
......
......@@ -15,7 +15,7 @@ using Microsoft.Extensions.Hosting;
using AutoMapper;
using ApplicationDomain.Abstraction;
using ApplicationDomain.Repositories;
using ApplicationCore.DomainModel;
using ApplicationCore.DTOs;
using ApplicationCore.Mapper;
using System;
using Microsoft.AspNetCore.Http;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebPresentation.ViewModels
{
public class MedicalStateMedicineVModel : BaseViewModel
{
public int MedicineId { get; set; }
public int MedicalStateId { get; set; }
}
}
using System;
namespace WebPresentation.ViewModels
{
public class CategoryViewModel : BaseViewModel
{
public String Name { get; set; }
}
}
\ No newline at end of file
using System;
namespace WebPresentation.ViewModels
{
public class MedicineTypeViewModel : BaseViewModel
{
public String TypeName { get; set; }
}
}
\ No newline at end of file
using ApplicationDomain.Entities;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebPresentation.ViewModels
{
......@@ -18,8 +14,8 @@ namespace WebPresentation.ViewModels
public int Price { get; set; }
public String Image { get; set; }
public int Dosage { get; set; }
public String Category { get; set; }
public String MedicineType { get; set; }
public CategoryViewModel Category { get; set; }
public MedicineTypeViewModel MedicineType { get; set; }
public ICollection<IngredientViewModel> Ingredients { get; set; }
public ICollection<MedicineIngredientViewModel> MedicineIngredients { get; set; }
......
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebPresentation.ViewModel
{
public class PatientMedicineViewModel
{
public IEnumerable<Patient> Patients { get; set; }
public IEnumerable<Medicine> Medicines { get; set; }
}
}
......@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebPresentation.ViewModel
namespace WebPresentation.ViewModels
{
public class PatientMedicinesViewModel
{
......
......@@ -15,8 +15,6 @@ namespace WebPresentation.ViewModels
public User User { get; set; }
public String BIO { get; set; }
#region Navigations
public ICollection<MedicalStateViewModel> MedicalStates { get; set; }
#endregion Navigations
}
}
@model PatientModel
@model PatientViewModel
......
@model PatientModel
@model PatientViewModel
......

@using Microsoft.AspNetCore.Identity ;
@model PatientModel ;
@model PatientViewModel ;
@inject SignInManager<User> SignInManager
@inject UserManager<User> UserManager
......
@model IngredientModel
@model IngredientViewModel
@{
ViewData["Title"] = "Create";
......
@model IngredientModel
@model IngredientViewModel
@{
ViewData["Title"] = "Delete";
......@@ -7,39 +7,37 @@
}
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<h5 class="modal-title" id="modalEditLabel">Delete Ingredient</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h1>Delete</h1>
<div class="modal-body container-fluid">
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Ingredient</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
<dt class="col-6">
@Html.DisplayNameFor(model => model.Name)
</dt>
<dd class="col-sm-10">
<dd class="col-6">
@Html.DisplayFor(model => model.Name)
</dd>
<dt class="col-sm-2">
<dt class="col-6">
@Html.DisplayNameFor(model => model.Description)
</dt>
<dd class="col-sm-10">
<dd class="col-6">
@Html.DisplayFor(model => model.Description)
</dd>
</dl>
<hr />
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</form>
</div>
</div>
\ No newline at end of file
@model IngredientModel
@model IngredientViewModel
@{
ViewData["Title"] = "Details";
......
@model IngredientModel;
@model IngredientViewModel;
@{
ViewData["Title"] = "Edit";
......@@ -7,8 +7,8 @@
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<h5 class="modal-title" id="modalEditLabel">Edit Ingredient</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
......@@ -32,14 +32,13 @@
<input type="hidden" asp-for="Id" />
<div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" />
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</form>
</div>
</div>
<div>
<a asp-action="Index">Back to List</a>
</div>
</div>
@section Scripts {
......
@model IEnumerable<IngredientModel>
@model IEnumerable<IngredientViewModel>
@{
ViewData["Title"] = "Index";
......
@model IEnumerable<MedicineModel>
@model IEnumerable<MedicineViewModel>
@(ViewData["Title"]="Medicines Galary")
@{
var t = 0;
......
@model MedicalStateModel
@model MedicalStateViewModel
@{
ViewData["Title"] = "Create";
......
@model MedicalStateModel
@model MedicalStateViewModel
@{
ViewData["Title"] = "Delete";
......@@ -7,7 +7,7 @@
}
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<h5 class="modal-title" id="modalEditLabel">Delete Medical Case</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
......@@ -16,11 +16,9 @@
<div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Medical State</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
......@@ -46,7 +44,8 @@
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</form>
</div>
......
@model MedicalStateModel
@model MedicalStateViewModel
@{
ViewData["Title"] = "Medical State Details ";
ViewData["Title"] = "Medical Case Details ";
ViewData["Controller"] = "MedicalState";
......@@ -76,7 +76,7 @@
<td>@ing.Dosage</td>
<td>@ing.ManufactureName</td>
<td>
<button class="btn btn-danger" ondblclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete @ing.TradeName From this medical Case" , "ReomveMedicine" ,@ing.Id)'>Delete</button>
<button class="btn btn-danger" onclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete @ing.TradeName From this medical Case" , "ReomveMedicine" ,@ing.Id)'>Delete</button>
<button class="btn btn-primary" onclick="DetailMedicine( @ing.Id)">Details</button>
</td>
......@@ -95,7 +95,7 @@
<hr />
<div class="row pt-1">
<button onclick="fetchMedicines()" class="btn btn-primary">Get Medicines </button>
<button onclick="fetchMedicines()" class="btn btn-primary">Get All Medicines </button>
</div>
</div>
......@@ -136,9 +136,9 @@
</button>
</div>
<div class="modal-body text-start p-3">
<h5 class="modal-title text-uppercase mb-5" id="exampleModalLabel">${title}</h5>
<h5 class="modal-title text-uppercase mb-5" id="exampleModalLabel">title</h5>
<p class=" mb-5"> ${message}</p>
<p class=" mb-5"> message</p>
<hr class="mt-2 mb-4"
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
......@@ -155,10 +155,10 @@
async function fetchMedicines() {
try {
debugger
let response = await fetch('/MedicalState/GetMedicines'); // Adjust the endpoint as needed
let response = await fetch('/MedicalState/GetAllMedicines'); // Adjust the endpoint as needed
if (response.ok) {
let medicines = await response.json();
populateTable(medicines, 'medicines-table');
populateTable(medicines.result, 'medicines-table');
} else {
console.error('Error:', response.statusText);
}
......@@ -174,7 +174,7 @@
let response = await fetch(`/MedicalState/GetMedicalStateMedicine/?id=${id}`); // Adjust the endpoint as needed
if (response.ok) {
let medicines = await response.json();
populateTable(medicines, 'Ingredients_');
populateTable(medicines.result, 'Ingredients_');
} else {
console.error('Error:', response.statusText);
}
......@@ -187,7 +187,7 @@
let tableBody = document.querySelector('#' + tableName);
tableBody.innerHTML = `
<table class="table">
<table id="${tableName}" class="table">
<thead>
<tr class="mb-3">
<td>ID</td>
......@@ -201,9 +201,9 @@
</td>
</tr>
</thead ><tbody id="b"> </tbody></table>`;
</thead ><tbody id="${tableName +"b"}"> </tbody></table>`;
tableBody = document.querySelector('#b');
tableBody = document.querySelector("#" + tableName + "b");
medicines.forEach(medicine => {
let row = document.createElement('tr');
......@@ -224,8 +224,8 @@
`
<td>
<button class="btn btn-danger" ondblclick="ReomveMedicine(${medicine.id})">Delete</button>
<button class="btn btn-primary" onclick="DetailMedicine( ${medicine.id})">Details</button>
<button class="btn btn-primary" onclick="DetailMedicine( ${medicine.id})">Details</button>
<button class="btn btn-danger" onclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete ${medicine.name} From this medical Case" , "ReomveMedicine" ,${medicine.id})'>Delete</button>
</td>
` :
......@@ -242,7 +242,7 @@
async function addMedicine(med) {
let id =@Model.Id;
try {
showToast('Loading ... ', 'Adding medicine');
// showToast('Loading ... ', 'Adding medicine');
let response = await fetch(`/MedicalState/AddMedicine`, {
method: 'POST',
......@@ -255,9 +255,10 @@
if (response.ok) {
let result = await response.json();
updateMedicines();
showToast('Medicine added successfully', 'Success');
showToast(result.message, 'Success');
} else {
console.error('Error:', response.statusText);
if (response)
showToast('Failed to add medicine', 'Error');
}
} catch (error) {
......@@ -269,7 +270,7 @@
let id =@Model.Id;
try {
debugger
let response = await fetch(`/MedicalState/GetDetails/${med}`, {
let response = await fetch(`/MedicalState/GetMedicineDetails/${med}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
......@@ -279,7 +280,7 @@
if (response.ok) {
let result = await response.json();
console.log(result)
showModal('Medicine Details',result );
showModal('Medicine Details', result.result);
} else {
console.error('Error:', response.statusText);
showToast('Failed to add medicine', 'Error');
......@@ -318,32 +319,6 @@
showToast('Failed to remove medicine', 'Error');
}
}
async function Reomve(med) {
debugger
try {
// showToast('Loading ... ', 'Removing medicine');
let response = await fetch(`/MedicalState/Delete/${med}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
});
if (response.ok) {
// let result = await response.json();
document.location.href="/MedicalState/"
showToast('Medicine Reomved successfully', 'Success');
} else {
console.error('Error:', response.statusText);
showToast('Failed to remove medicine', 'Error');
}
} catch (error) {
console.error('Fetch error:', error);
showToast('Failed to remove medicine', 'Error');
}
}
async function DeleteConfirm(title, message, action,param) {
debugger
const modalBody = document.querySelector('#item-container');
......@@ -368,7 +343,7 @@
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
<div class="modal-footer d-flex justify-content-center border-top-0 py-4">
<button class="btn btn-danger" onclick="${action}(${param})">Delete</button>
<button class="btn btn-danger" onclick="${action}(${param})" data-dismiss="modal" aria-label="Close">Delete</button>
<button class="btn btn-info" class="close" data-dismiss="modal" aria-label="Close">Close</button>
</div>
......@@ -381,11 +356,11 @@
}
function showToast(message, title) {
const Modal = bootstrap.Modal.getInstance(document.getElementById('item'));
// const Modal = bootstrap.Modal.getInstance(document.getElementById('item'));
// Modal.close();
// if (Modal) Modal.hide();
// Modal.toggle();
Modal.dispose();
// Modal.dispose();
const emedicineModal = new bootstrap.Modal(document.getElementById('item'));
emedicineModal.hide();
const modalBody = document.querySelector('#item-container');
......
@model MedicalStateModel
@model MedicalStateViewModel
@{
ViewData["Title"] = "Edit";
......@@ -8,8 +8,8 @@
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<h5 class="modal-title" id="modalEditLabel">Edit Medical Case</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
......@@ -42,14 +42,13 @@
<div class="form-group">
<input hidden value="@ViewBag.id" name="pId" />
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<input type="submit" value="Save" class="btn btn-primary" />
</div>
<input hidden value="@Model.PatientId" asp-for="@Model.PatientId" />
</form>
<a asp-action="Index">Back to List</a>
</div>
......
@model IEnumerable<MedicalStateModel>;
@model IEnumerable<MedicalStateViewModel>;
@{
ViewData["Title"] = "Medical states ";
......
@model IEnumerable<IngredientModel>
@model IEnumerable<IngredientViewModel>
@{
}
<section class="page-section p-5 m-5">
......
@model MedicineModel
@model MedicineViewModel
@{
ViewData["Title"] = "Create";
......
@model MedicineModel
@model MedicineViewModel
@{
ViewData["Title"] = "Delete";
......@@ -8,50 +8,57 @@
}
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<h5 class="modal-title" id="modalEditLabel">Delete Medicine</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Medicine</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.TradeName)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.TradeName)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Description)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Description)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Category.Name)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Category.Name)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Price)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Price)
</dd>
</dl>
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
</form>
</div>
<hr />
<dl class="row">
<dt class="col">
@Html.DisplayNameFor(model => model.TradeName)
</dt>
<dd class="col">
@Html.DisplayFor(model => model.TradeName)
</dd>
</dl>
<dl>
<dt class="col">
@Html.DisplayNameFor(model => model.Description)
</dt>
<dd class="col">
@Html.DisplayFor(model => model.Description)
</dd>
</dl>
<dl>
<dt class="col">
@Html.DisplayNameFor(model => model.Category.Name)
</dt>
<dd class="col">
@Html.DisplayFor(model => model.Category.Name)
</dd>
</dl>
<dl>
<dt class="col">
@Html.DisplayNameFor(model => model.Price)
</dt>
<dd class="col">
@Html.DisplayFor(model => model.Price)
</dd>
</dl>
<hr />
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" />
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
</form>
</div>
</div>
\ No newline at end of file
@model MedicineModel
@model MedicineViewModel
@{
ViewData["Title"] = "Medicine Details ";
......@@ -59,7 +59,7 @@
<td>@ing.Ingredient.Description</td>
<td>@ing.Ratio</td>
<td>
<button class="btn btn-danger" ondblclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete @ing.Ingredient.Name From this medicine", "ReomveIngredient",@ing.Id)'>Delete</button>
<button class="btn btn-danger" ondblclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete @ing.Ingredient.Name From this medicine", "ReomveIngredient",@ing.IngredientId)'>Delete</button>
</td>
</tr>
......@@ -109,11 +109,11 @@
async function fetchAll() {
try {
debugger
let response = await fetch('/Ingredient/GetIngredients'); // Adjust the endpoint as needed
let response = await fetch('/Ingredient/GetAll'); // Adjust the endpoint as needed
if (response.ok) {
let medicines = await response.json();
// showModal('',medicines);
populateTable(medicines,'t')
populateTable(medicines.result,'t')
} else {
console.error('Error:', response.statusText);
showToast(medicines, 'error');
......@@ -127,7 +127,7 @@
let id =@Model.Id;
debugger;
try {
let response = await fetch(`/Medicine/GetDetails/${id}`); // Adjust the endpoint as needed
let response = await fetch(`/Medicine/GetMedcineIngredient/${id}`); // Adjust the endpoint as needed
if (response.ok) {
let medicines = await response.json();
medicines = medicines.medicineIngredients
......@@ -173,11 +173,12 @@
`
<td>
<button class="btn btn-danger" ondblclick="ReomveIngredient(${medicine.id})">Delete</button>
</td>
<button class="btn btn-danger" ondblclick='DeleteConfirm("Delete Confirm", "Are you sure you want to delete ${medicine.name}From this medicine", "ReomveIngredient",${medicine.ingredient.id})'>Delete</button>
</td>
` :
`<td>
<button class="btn btn-primary" onclick="addIngredient( ${medicine.id})">Add</button>
<button class="btn btn-primary" onclick="addIngredient( ${medicine.id})" data-dismiss="modal" aria-label="Close">Add</button>
</td>
`
......@@ -211,7 +212,9 @@
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
<div class="modal-footer d-flex justify-content-center border-top-0 py-4">
<button class="btn btn-info" onclick="addIngredientT(${med})">Add</button>
<button class="btn btn-info" onclick="addIngredientT(${med})" data-dismiss="modal" aria-label="Close">Add</button>
<button class="btn btn-primary" data-dismiss="modal" aria-label="Close">Close</button>
</div>
</div>
</div>
......@@ -228,7 +231,7 @@
var r = document.getElementById('r').value;
console.log(r)
let response = await fetch(`/Medicine/AddIngredints`, {
let response = await fetch(`/Medicine/AddIngredient`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
......@@ -327,7 +330,7 @@
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
<div class="modal-footer d-flex justify-content-center border-top-0 py-4">
<button class="btn btn-danger" onclick="${action}(${param})">Delete</button>
<button class="btn btn-danger" onclick="${action}(${param})" data-dismiss="modal" aria-label="Close">Delete</button>
<button class="btn btn-info" class="close" data-dismiss="modal" aria-label="Close">Close</button>
</div>
......
@model MedicineModel;
@model MedicineViewModel;
@*@{
ViewData["Title"] = "Edit";
......@@ -7,7 +7,7 @@
}*@
<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
......@@ -45,7 +45,7 @@
</div>
<div class="form-group row">
<div class="col ">
<label for="Category.Name" class="control-label"></label>
<label for="Category.Name" class="control-label">Category</label>
<input asp-for="Category.Name" class="form-control" />
<span asp-validation-for="Category.Name" class="text-danger"></span>
......@@ -85,7 +85,7 @@
<input type="hidden" asp-for="Id" />
<div class="form-group">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<input type="submit" value="Save" class="btn btn-primary" />
</div>
......
@model IEnumerable<MedicineModel>;
@model IEnumerable<MedicineViewModel>;
@{
ViewData["Title"] = "Index";
......
......@@ -201,7 +201,6 @@
});
</script>
<!-- Bootstrap core JavaScript -->
<script src="~/js/jquery.min.js"></script>
<script src="~/js/bootstrap.bundle.min.js"></script>
......@@ -210,5 +209,7 @@
<script src="~/js/jquery.easing.min.js"></script>
<!-- Custom scripts for this template -->
<script src="~/js/freelancer.min.js"></script>
<!-- Custom scripts for this template -->
</body>
</html>

<div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">OOPs </h5>
<hr />
<p>Not Found</p>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
@using WebPresentation
@using WebPresentation.Models
@using ApplicationCore.DomainModel;
@using ApplicationDomain.Entities;
@using WebPresentation.ViewModels
@using ApplicationDomain.Entities
@using ApplicationCore.DTOs
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using System
\ No newline at end of file
......@@ -28,7 +28,6 @@
<ItemGroup>
<Folder Include="Filters\" />
<Folder Include="Services Consumers\" />
<Folder Include="Views\Patients\" />
</ItemGroup>
......
......@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable
#nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models;
using WebPresentation.ViewModels;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
using ApplicationCore.DTOs;
#line default
#line hidden
......@@ -47,7 +47,7 @@ using System;
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"d8ddb6bffa5a9b264bf8f89038bf03c234083fd3", @"/Views/Home/Privacy.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a2f5fee0d7223f937b9f0309fc3b9062263e26d", @"/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\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "03da15210833c5aaf63a9787f6d01d7625911299"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a408e525829337b77ae58353a38e63ed6e3b9e4e"
// <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")]
......@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable
#nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models;
using WebPresentation.ViewModels;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
using ApplicationCore.DTOs;
#line default
#line hidden
......@@ -46,9 +46,9 @@ using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"03da15210833c5aaf63a9787f6d01d7625911299", @"/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>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"a408e525829337b77ae58353a38e63ed6e3b9e4e", @"/Views/Ingredient/Details.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a2f5fee0d7223f937b9f0309fc3b9062263e26d", @"/Views/_ViewImports.cshtml")]
public class Views_Ingredient_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IngredientViewModel>
{
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);
......@@ -100,7 +100,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, "03da15210833c5aaf63a9787f6d01d76259112996336", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "a408e525829337b77ae58353a38e63ed6e3b9e4e6337", async() => {
}
);
__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
......@@ -141,7 +141,7 @@ using System;
#line hidden
#nullable disable
WriteLiteral("\">Delete</button>\r\n\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "03da15210833c5aaf63a9787f6d01d76259112998694", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "a408e525829337b77ae58353a38e63ed6e3b9e4e8695", async() => {
WriteLiteral("\r\n\r\n <i class=\"far fa-backward\">\r\n\r\n </i>\r\n ");
}
);
......@@ -225,7 +225,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<IngredientModel> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<IngredientViewModel> Html { get; private set; }
}
}
#pragma warning restore 1591
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Index.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "078449fe7e30ff1d0badd82e8a5b99967e499556"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Ingredient\Index.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "fa65c3d050990672a6d64428d63e48b961383d29"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Ingredient_Index), @"mvc.1.0.view", @"/Views/Ingredient/Index.cshtml")]
......@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable
#nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models;
using WebPresentation.ViewModels;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
using ApplicationCore.DTOs;
#line default
#line hidden
......@@ -46,9 +46,9 @@ using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"078449fe7e30ff1d0badd82e8a5b99967e499556", @"/Views/Ingredient/Index.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
public class Views_Ingredient_Index : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<IngredientModel>>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"fa65c3d050990672a6d64428d63e48b961383d29", @"/Views/Ingredient/Index.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a2f5fee0d7223f937b9f0309fc3b9062263e26d", @"/Views/_ViewImports.cshtml")]
public class Views_Ingredient_Index : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<IngredientViewModel>>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "Create", 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("btn btn-primary "), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
......@@ -105,7 +105,7 @@ using System;
#line hidden
#nullable disable
WriteLiteral("</a>\r\n <div class=\"small text-white\"><i class=\"fas fa-angle-right\"></i></div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<p>\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "078449fe7e30ff1d0badd82e8a5b99967e4995565982", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "fa65c3d050990672a6d64428d63e48b961383d295983", async() => {
WriteLiteral("Create New");
}
);
......@@ -217,7 +217,7 @@ using System;
#line hidden
#nullable disable
WriteLiteral("\">Delete</button>\r\n\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "078449fe7e30ff1d0badd82e8a5b99967e49955610885", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "fa65c3d050990672a6d64428d63e48b961383d2910886", async() => {
WriteLiteral("<i class=\"far fa-address-card\"></i>");
}
);
......@@ -269,7 +269,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<IEnumerable<IngredientModel>> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<IEnumerable<IngredientViewModel>> 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}" "17e165cd546d9b403ea75a1b085b72fcd2359e67"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "29670b936c66297cbf587d3a06248a14ad551381"
// <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")]
......@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable
#nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models;
using WebPresentation.ViewModels;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
using ApplicationCore.DTOs;
#line default
#line hidden
......@@ -46,9 +46,9 @@ using System;
#line default
#line hidden
#nullable disable
[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>>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"29670b936c66297cbf587d3a06248a14ad551381", @"/Views/Medicine/AddIngredints.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a2f5fee0d7223f937b9f0309fc3b9062263e26d", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_AddIngredints : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<IngredientViewModel>>
{
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);
......@@ -82,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, "17e165cd546d9b403ea75a1b085b72fcd2359e675412", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "29670b936c66297cbf587d3a06248a14ad5513815413", 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, "17e165cd546d9b403ea75a1b085b72fcd2359e675899", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("select", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "29670b936c66297cbf587d3a06248a14ad5513815900", async() => {
WriteLiteral("\r\n");
#nullable restore
#line 15 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
......@@ -95,7 +95,7 @@ using System;
#line hidden
#nullable disable
WriteLiteral(" ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "17e165cd546d9b403ea75a1b085b72fcd2359e676438", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("option", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "29670b936c66297cbf587d3a06248a14ad5513816439", async() => {
#nullable restore
#line 17 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
Write(i.Name);
......@@ -156,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=\"", 683, "\"", 710, 1);
BeginWriteAttribute("value", " value=\"", 687, "\"", 714, 1);
#nullable restore
#line 25 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
WriteAttributeValue("", 691, ViewBag.MedicineId, 691, 19, false);
WriteAttributeValue("", 695, ViewBag.MedicineId, 695, 19, false);
#line default
#line hidden
......@@ -196,7 +196,7 @@ WriteAttributeValue("", 691, ViewBag.MedicineId, 691, 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<IngredientModel>> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<IEnumerable<IngredientViewModel>> Html { get; private set; }
}
}
#pragma warning restore 1591
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Index.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "ef68d88abaade8de74ca3f2f4ef6df3304c3414b"
#pragma checksum "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\Index.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7313ad17be51b480fe4e1dd7b62733fb02c877b8"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_Index), @"mvc.1.0.view", @"/Views/Medicine/Index.cshtml")]
......@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable
#nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models;
using WebPresentation.ViewModels;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
using ApplicationCore.DTOs;
#line default
#line hidden
......@@ -46,9 +46,9 @@ using System;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"ef68d88abaade8de74ca3f2f4ef6df3304c3414b", @"/Views/Medicine/Index.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_Index : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<MedicineModel>>
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"7313ad17be51b480fe4e1dd7b62733fb02c877b8", @"/Views/Medicine/Index.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a2f5fee0d7223f937b9f0309fc3b9062263e26d", @"/Views/_ViewImports.cshtml")]
public class Views_Medicine_Index : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<MedicineViewModel>>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "Create", 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("btn btn-primary "), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
......@@ -105,10 +105,10 @@ using System;
#line hidden
#nullable disable
WriteLiteral("</a>\r\n <div class=\"small text-white\"><i class=\"fas fa-angle-right\"></i></div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n </div>\r\n\r\n<div>\r\n <i");
BeginWriteAttribute("class", " class=\"", 669, "\"", 677, 0);
BeginWriteAttribute("class", " class=\"", 673, "\"", 681, 0);
EndWriteAttribute();
WriteLiteral("></i>\r\n Medicines Details\r\n <p>\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "ef68d88abaade8de74ca3f2f4ef6df3304c3414b6136", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "7313ad17be51b480fe4e1dd7b62733fb02c877b86137", async() => {
WriteLiteral("Create New");
}
);
......@@ -258,7 +258,7 @@ using System;
#line hidden
#nullable disable
WriteLiteral("\">Delete</button>\r\n\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "ef68d88abaade8de74ca3f2f4ef6df3304c3414b12679", async() => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "7313ad17be51b480fe4e1dd7b62733fb02c877b812680", async() => {
WriteLiteral("<i class=\"far fa-address-card\"></i>");
}
);
......@@ -310,7 +310,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<IEnumerable<MedicineModel>> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<IEnumerable<MedicineViewModel>> Html { get; private set; }
}
}
#pragma warning restore 1591
......@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable
#nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models;
using WebPresentation.ViewModels;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel;
using ApplicationDomain.Entities;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities;
using ApplicationCore.DTOs;
#line default
#line hidden
......@@ -47,7 +47,7 @@ using System;
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"c4eee3f4993d74b115dec849687defce31fb03ba", @"/Views/Shared/Error.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"00a5efe30164a0b2b148ed0b3ef352c1f6e80ba1", @"/Views/_ViewImports.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"4a2f5fee0d7223f937b9f0309fc3b9062263e26d", @"/Views/_ViewImports.cshtml")]
public class Views_Shared_Error : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
{
#pragma warning disable 1998
......
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