Commit b458f569 authored by hasan khaddour's avatar hasan khaddour

fix s

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

namespace ApplicationCore.DTOs
{
public class DTOBase
{
public int Id { get; set; }
}
}
...@@ -4,12 +4,13 @@ using System.Linq; ...@@ -4,12 +4,13 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.DomainModel namespace ApplicationCore.DTOs
{ {
public class CategoryModel : DomainBase public class IngredientDTO : DTOBase
{ {
public String Name { get; set; } public String Name { get; set; }
// public ICollection<MedicineModel> Medicines { get; set; } public String Description { get; set; }
} }
} }
...@@ -4,15 +4,15 @@ using System.Linq; ...@@ -4,15 +4,15 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; 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 Ratio { get; set; }
public int MedicineId { get; set; } public int MedicineId { get; set; }
public int IngredientId { get; set; } public int IngredientId { get; set; }
public MedicineModel Medicine { get; set; } public MedicineDTO Medicine { get; set; }
public IngredientModel Ingredient { get; set; } public IngredientDTO Ingredient { get; set; }
} }
} }
...@@ -4,17 +4,15 @@ using System.Linq; ...@@ -4,17 +4,15 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.DomainModel namespace ApplicationCore.DTOs
{ {
public class MedicalStateModel : DomainBase public class MedicalStateDTO : DTOBase
{ {
public int PatientId { get; set; } public int PatientId { get; set; }
public String StateName { get; set; } public String StateName { get; set; }
public String StateDescription { get; set; } public String StateDescription { get; set; }
public DateTime PrescriptionTime { get; set; } public DateTime PrescriptionTime { get; set; }
public ICollection<MedicineModel> Medicines { get; set; } public ICollection<MedicineDTO> Medicines { get; set; }
// public ICollection<MedicalStateMedicineModel> MedicalStateMedicines { get; set; }
} }
} }
...@@ -4,18 +4,12 @@ using System.Linq; ...@@ -4,18 +4,12 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; 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 MedicineId { get; set; }
public int MedicalStateId { 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.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; 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; ...@@ -5,9 +5,9 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.DomainModel namespace ApplicationCore.DTOs
{ {
public class MedicineModel : DomainBase public class MedicineDTO : DTOBase
{ {
public String TradeName { get; set; } public String TradeName { get; set; }
...@@ -18,12 +18,10 @@ namespace ApplicationCore.DomainModel ...@@ -18,12 +18,10 @@ namespace ApplicationCore.DomainModel
public int Price { get; set; } public int Price { get; set; }
public String Image { get; set; } public String Image { get; set; }
public int Dosage { get; set; } public int Dosage { get; set; }
public CategoryModel Category { get; set; } public CategoryDTO Category { get; set; }
public MedicineTypeModel MedicineType { get; set; } public MedicineTypeDTO MedicineType { get; set; }
public ICollection<IngredientModel> Ingredients { get; set; } public ICollection<IngredientDTO> Ingredients { get; set; }
// public ICollection<MedicalStateModel> MedicalStates { get; set; } public ICollection<MedicineIngredientDTO> MedicineIngredients { get; set; }
// public ICollection<MedicalStateMedicineModel> MedicalStateMedicines { get; set; }
public ICollection<MedicineIngredientModel> MedicineIngredients { get; set; }
} }
} }
...@@ -4,11 +4,10 @@ using System.Linq; ...@@ -4,11 +4,10 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.DomainModel namespace ApplicationCore.DTOs
{ {
public class MedicineTypeModel : DomainBase public class MedicineTypeDTO : DTOBase
{ {
public String TypeName { get; set; } public String TypeName { get; set; }
// public ICollection<MedicineModel> Medicines { get; set; }
} }
} }
...@@ -5,9 +5,9 @@ using System.Linq; ...@@ -5,9 +5,9 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; 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 ...@@ -15,10 +15,6 @@ namespace ApplicationCore.DomainModel
public User User { get; set; } public User User { get; set; }
public String BIO { get; set; } public String BIO { get; set; }
#region Relations public ICollection<MedicalStateDTO> MedicalStates { get; set; }
public ICollection<MedicalStateModel> MedicalStates { get; set; }
//public ICollection<Medicine> Medicines { get; set; }
// public ICollection<PatientMedicine> PatientMedicines { get; set; }
#endregion Relations
} }
} }
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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.Interfaces namespace ApplicationCore.Interfaces
{ {
public interface IService<T> where T : class public interface IService<T> where T : DTOBase
{ {
public Task<IEnumerable<T>> GetAll(); 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 void Delete(int Id);
public T Update(T tModel); public T Update(T tModel);
public T Create(T tModel); public T Create(T tModel);
......
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices namespace ApplicationCore.Interfaces.IServices
{ {
public interface IIngredientService : IService<IngredientModel> public interface IIngredientService : IService<IngredientDTO>
{ {
public Task<MedicineIngredientModel> AddToMedicine(MedicineIngredientModel medicineIngredientModel); public Task AddToMedicine(MedicineIngredientDTO medicineIngredientDto);
public Task RemoveFromMedicine(MedicineIngredientModel medicineIngredientModel); public Task RemoveFromMedicine(MedicineIngredientDTO medicineIngredientDto);
} }
} }
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices namespace ApplicationCore.Interfaces.IServices
{ {
public interface IMedicalStateService : IService<MedicalStateModel> public interface IMedicalStateService : IService<MedicalStateDTO>
{ {
public Task<IEnumerable<MedicalStateModel>> GetAllPatientMedicalStates(int patientId); public Task<IEnumerable<MedicalStateDTO>> GetAllPatientMedicalStates(int patientId);
public MedicalStateModel AddToPateint(int patientId , MedicalStateModel medicalState); public MedicalStateDTO AddToPateint(int patientId , MedicalStateDTO medicalState);
} }
......
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationDomain.Entities;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices namespace ApplicationCore.Interfaces.IServices
{ {
public interface IMedicineService :IService<MedicineModel> public interface IMedicineService :IService<MedicineDTO>
{ {
public MedicineModel GetMedicineIngredentisDetails(int medicineId); public MedicineDTO GetMedicineIngredentisDetails(int medicineId);
public void AddToMedicalState(MedicalStateMedicineModel medicalStateMedicineModel); public void AddToMedicalState(MedicalStateMedicineDTO medicalStateMedicineModel);
public void RemoveFromMedicalState(MedicalStateMedicineModel medicalStateMedicineModel); public void RemoveFromMedicalState(MedicalStateMedicineDTO medicalStateMedicineModel);
public Task<IEnumerable<MedicineIngredientDTO>> GetMedicineIngredients( int id);
} }
} }
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationDomain.Entities;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.Interfaces.IServices namespace ApplicationCore.Interfaces.IServices
{ {
public interface IPatientService :IService<PatientModel> public interface IPatientService :IService<PatientDTO>
{ {
public Task<IEnumerable<MedicalStateModel>> GetPatientMedicalStates(int patientId); public Task<IEnumerable<MedicalStateDTO>> GetPatientMedicalStates(int patientId);
public Task<MedicalStateModel> GetMedicalStateDetails(int id); public Task<MedicalStateDTO> GetMedicalStateDetails(int id);
public Task<PatientModel> GetByUserEmail(String email ); public Task<PatientDTO> GetByUserEmail(String email );
public Task<PatientModel> GetByUserId(String email); public Task<PatientDTO> GetByUserId(String email);
// public Task<IEnumerable<PatientModel>>GetAll(); // 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 Patient GetDetails(int id);
// public void Insert(PatientModel patient); // public void Insert(PatientModel patient);
// public void Update(Patient patient); // public void Update(Patient patient);
......
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationDomain.Entities; using ApplicationDomain.Entities;
using AutoMapper; using AutoMapper;
using System;
using System.Linq.Expressions;
namespace ApplicationCore.Mapper namespace ApplicationCore.Mapper
{ {
...@@ -10,13 +10,13 @@ namespace ApplicationCore.Mapper ...@@ -10,13 +10,13 @@ namespace ApplicationCore.Mapper
{ {
public ObjectMapper() { public ObjectMapper() {
CreateMap<Medicine, MedicineModel>() CreateMap<Medicine, MedicineDTO>()
.ForMember(dest => dest.Category, opt => opt.MapFrom(src => src.Category)) .ForMember(dest => dest.Category, opt => opt.MapFrom(src => src.Category))
.ForMember(dest => dest.MedicineType, opt => opt.MapFrom(src => src.MedicineType)) .ForMember(dest => dest.MedicineType, opt => opt.MapFrom(src => src.MedicineType))
.ForMember(dest => dest.Ingredients, opt => opt.MapFrom(src => src.Ingredients)) .ForMember(dest => dest.Ingredients, opt => opt.MapFrom(src => src.Ingredients))
.ForMember(dest => dest.MedicineIngredients, opt => opt.MapFrom(src => src.MedicineIngredients)); .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.Ingredients, o => o.MapFrom(s => s.Ingredients))
.ForMember(de => de.MedicineIngredients, o => o.MapFrom(s => s.MedicineIngredients)) .ForMember(de => de.MedicineIngredients, o => o.MapFrom(s => s.MedicineIngredients))
.ForMember(de => de.MedicineType, o => o.MapFrom(s => s.MedicineType)) .ForMember(de => de.MedicineType, o => o.MapFrom(s => s.MedicineType))
...@@ -24,30 +24,30 @@ namespace ApplicationCore.Mapper ...@@ -24,30 +24,30 @@ namespace ApplicationCore.Mapper
.ForMember(dest => dest.MedicalStates, opt => opt.Ignore()) .ForMember(dest => dest.MedicalStates, opt => opt.Ignore())
.ForMember(dest => dest.MedicalStateMedicines, opt => opt.Ignore()) .ForMember(dest => dest.MedicalStateMedicines, opt => opt.Ignore())
; ;
CreateMap<PatientModel, Patient>().ReverseMap(); CreateMap<PatientDTO, Patient>().ReverseMap();
CreateMap<Patient, PatientModel>().ReverseMap(); CreateMap<Patient, PatientDTO>().ReverseMap();
CreateMap<Ingredient, IngredientModel>().ReverseMap(); CreateMap<Ingredient, IngredientDTO>().ReverseMap();
CreateMap<MedicalState, MedicalStateModel>() CreateMap<MedicalState, MedicalStateDTO>()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id)) .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
// .ForMember(dest => dest.Patient, opt => opt.MapFrom(src => src.Patient)) // .ForMember(dest => dest.Patient, opt => opt.MapFrom(src => src.Patient))
.ForMember(dest => dest.Medicines, opt => opt.MapFrom(src => src.Medicines)); .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.Id, opt => opt.MapFrom(src => src.Id))
// .ForMember(dest => dest.Patient, opt => opt.MapFrom(src => src.Patient)) // .ForMember(dest => dest.Patient, opt => opt.MapFrom(src => src.Patient))
.ForMember(dest => dest.Medicines, opt => opt.MapFrom(src => src.Medicines)) .ForMember(dest => dest.Medicines, opt => opt.MapFrom(src => src.Medicines))
.ForMember(s=>s.MedicalStateMedicines , op=>op.Ignore()) .ForMember(s=>s.MedicalStateMedicines , op=>op.Ignore())
.ForMember(s => s.Patient, op => op.Ignore()); .ForMember(s => s.Patient, op => op.Ignore());
CreateMap<Category, CategoryModel>(); CreateMap<Category, Category>();
CreateMap<CategoryModel, Category>() CreateMap<Category, Category>()
.ForMember(dest => dest.Medicines, opt => opt.Ignore()) .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 ApplicationCore.Interfaces;
using ApplicationDomain.Abstraction; using ApplicationDomain.Abstraction;
using ApplicationDomain.Exceptions; using ApplicationDomain.Exceptions;
...@@ -6,15 +6,13 @@ using ApplicationDomain.Entities; ...@@ -6,15 +6,13 @@ using ApplicationDomain.Entities;
using AutoMapper; using AutoMapper;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.Services 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 readonly IUnitOfWork<TEntity> _unitOfWork;
protected ISpecification<TEntity> _specification; protected ISpecification<TEntity> _specification;
...@@ -29,30 +27,30 @@ namespace ApplicationCore.Services ...@@ -29,30 +27,30 @@ namespace ApplicationCore.Services
_mapper = mapper; _mapper = mapper;
} }
public async Task<IEnumerable<TModel>> GetAll() public async Task<IEnumerable<TDto>> GetAll()
{ {
var r = await _unitOfWork.Entity.GetAll( var r = await _unitOfWork.Entity.GetAll(
_specification _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)); TEntity entity = _unitOfWork.Entity.Insert(_mapper.Map<TEntity>(model));
_unitOfWork.Commit(); _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)); TEntity entity = _unitOfWork.Entity.Update(_mapper.Map<TEntity>(model));
_unitOfWork.Commit(); _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, var model = await _unitOfWork.Entity.GetById(id,
...@@ -60,7 +58,7 @@ namespace ApplicationCore.Services ...@@ -60,7 +58,7 @@ namespace ApplicationCore.Services
if (model is null) { if (model is null) {
throw new NotFoundException(); throw new NotFoundException();
} }
return _mapper.Map<TModel>(model); return _mapper.Map<TDto>(model);
} }
...@@ -70,6 +68,28 @@ namespace ApplicationCore.Services ...@@ -70,6 +68,28 @@ namespace ApplicationCore.Services
_unitOfWork.Commit(); _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; ...@@ -3,17 +3,15 @@ using ApplicationCore.Interfaces;
using ApplicationCore.Interfaces.IServices; using ApplicationCore.Interfaces.IServices;
using ApplicationDomain.Abstraction; using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification; using ApplicationDomain.Specification;
using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using AutoMapper; using AutoMapper;
using System.Collections.Generic;
namespace ApplicationCore.Services namespace ApplicationCore.Services
{ {
public class IngredientService : ServiceBase<Ingredient,IngredientModel> , IIngredientService public class IngredientService : ServiceBase<Ingredient,IngredientDTO> , IIngredientService
{ {
public IngredientService( public IngredientService(
IUnitOfWork<Ingredient> unitOfWork, IUnitOfWork<Ingredient> unitOfWork,
...@@ -24,22 +22,23 @@ namespace ApplicationCore.Services ...@@ -24,22 +22,23 @@ namespace ApplicationCore.Services
} }
public async Task<MedicineIngredientModel> AddToMedicine(MedicineIngredientModel medicineIngredientModel) { public async Task AddToMedicine(MedicineIngredientDTO medicineIngredientDto) {
var medicine = await _unitOfWork.Entity.GetById(medicineIngredientModel.IngredientId,_specification); var medicine = await _unitOfWork.Entity.GetById(medicineIngredientDto.IngredientId,_specification);
MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientModel); MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientDto);
medicine.MedicineIngredients.Add( medicine.MedicineIngredients.Add(
medicineIngredient medicineIngredient
); );
_unitOfWork.Entity.Update(medicine); _unitOfWork.Entity.Update(medicine);
_unitOfWork.Commit(); _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); MedicineIngredient medicineIngredient = _mapper.Map<MedicineIngredient>(medicineIngredientDto);
var m =ingredient.MedicineIngredients.Where(p => p.MedicineId == medicineIngredientModel.MedicineId).FirstOrDefault(); var m =ingredient.MedicineIngredients.Where(p => p.MedicineId == medicineIngredientDto.MedicineId).FirstOrDefault();
ingredient.MedicineIngredients.Remove(m); ingredient.MedicineIngredients.Remove(m);
_unitOfWork.Entity.Update(ingredient); _unitOfWork.Entity.Update(ingredient);
......
...@@ -4,12 +4,12 @@ using ApplicationCore.Interfaces.IServices; ...@@ -4,12 +4,12 @@ using ApplicationCore.Interfaces.IServices;
using ApplicationDomain.Abstraction; using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification; using ApplicationDomain.Specification;
using AutoMapper; using AutoMapper;
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ApplicationCore.Services namespace ApplicationCore.Services
{ {
public class MedicalStateService :ServiceBase<MedicalState ,MedicalStateModel>, IMedicalStateService public class MedicalStateService :ServiceBase<MedicalState ,MedicalStateDTO>, IMedicalStateService
{ {
public MedicalStateService( public MedicalStateService(
...@@ -18,23 +18,23 @@ namespace ApplicationCore.Services ...@@ -18,23 +18,23 @@ namespace ApplicationCore.Services
):base(unitOfWork,Mapper) ):base(unitOfWork,Mapper)
{ {
_specification = new MedicalStateWithMedicinesSpecification(); _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)); var r = _unitOfWork.Entity.Insert(_mapper.Map<MedicalState>(im));
_unitOfWork.Commit(); _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) await _unitOfWork.MedicalStates.GetByPatient(patientId, _specification)
......
...@@ -4,11 +4,13 @@ using ApplicationDomain.Abstraction; ...@@ -4,11 +4,13 @@ using ApplicationDomain.Abstraction;
using ApplicationDomain.Specification; using ApplicationDomain.Specification;
using System.Collections.Generic; using System.Collections.Generic;
using AutoMapper; using AutoMapper;
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationDomain.Exceptions;
using System.Threading.Tasks;
namespace ApplicationCore.Services namespace ApplicationCore.Services
{ {
public class MedicineService : ServiceBase<Medicine,MedicineModel>,IMedicineService public class MedicineService : ServiceBase<Medicine,MedicineDTO>,IMedicineService
{ {
private MedicalStateWithMedicinesSpecification _medicalSpecification; private MedicalStateWithMedicinesSpecification _medicalSpecification;
...@@ -23,46 +25,57 @@ namespace ApplicationCore.Services ...@@ -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; var medicalState = _unitOfWork.Entity.GetById(medicalStateMedicineDto.MedicineId, _specification).Result;
if (medicalState.MedicalStateMedicines is null)
//if (medicalState.Medicines is null) medicalState.MedicalStateMedicines = new List<MedicalStateMedicine>();
// medicalState.Medicines = new List<Medicine>(); foreach (var i in medicalState.MedicalStateMedicines)
{
//var medicine = await _medicineUnitOfWork.Entity.GetById(medicalStateMedicineModel.MedicineId, _medicineSpecification); if (
if (medicine.MedicalStateMedicines is null) i.MedicalStateId == medicalStateMedicineDto.MedicalStateId
medicine.MedicalStateMedicines = new List<MedicalStateMedicine>(); &&
medicine.MedicalStateMedicines.Add( i.MedicineId == medicalStateMedicineDto.MedicineId
_mapper.Map<MedicalStateMedicine>( medicalStateMedicineModel )
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(); _unitOfWork.Commit();
} }
public void RemoveFromMedicalState(MedicalStateMedicineModel medicalStateMedicineModel) public void RemoveFromMedicalState(MedicalStateMedicineDTO medicalStateMedicineDto)
{ {
var m = _unitOfWork.MedicalStates.GetById(medicalStateMedicineModel.MedicalStateId, _medicalSpecification).Result; var medicalState = _unitOfWork.MedicalStates.GetById(medicalStateMedicineDto.MedicalStateId, _medicalSpecification).Result;
//// throw an exception if (medicalState.MedicalStateMedicines is null)
//if (m.Medicines is null) throw new DomainException("you dont have this medicine");
// m.Medicines = new List<Medicine>(); var d = _unitOfWork.Entity.GetById(medicalStateMedicineDto.MedicineId, _specification).Result;
var d = _unitOfWork.Entity.GetById(medicalStateMedicineModel.MedicineId, _specification).Result;
m.Medicines.Remove(d); if(! medicalState.Medicines.Remove(d))
throw new DomainException("you dont have this medicine");
_unitOfWork.MedicalStates.Update(m); _unitOfWork.MedicalStates.Update(medicalState);
_unitOfWork.Commit(); _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 , .GetById(medicineId ,
_specification)); _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; ...@@ -10,11 +10,11 @@ using System.Linq.Expressions;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using AutoMapper; using AutoMapper;
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
namespace ApplicationCore.Services namespace ApplicationCore.Services
{ {
public class PatientService : ServiceBase<Patient ,PatientModel> , IPatientService public class PatientService : ServiceBase<Patient ,PatientDTO> , IPatientService
{ {
private MedicalStateWithMedicinesSpecification _medicalStateSpecification; private MedicalStateWithMedicinesSpecification _medicalStateSpecification;
...@@ -27,10 +27,10 @@ namespace ApplicationCore.Services ...@@ -27,10 +27,10 @@ namespace ApplicationCore.Services
_medicalStateSpecification = new MedicalStateWithMedicinesSpecification(); _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 await _unitOfWork.MedicalStates
.GetByPatient( .GetByPatient(
patientId, _medicalStateSpecification patientId, _medicalStateSpecification
...@@ -38,14 +38,14 @@ namespace ApplicationCore.Services ...@@ -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; var ptient = _unitOfWork.Entity.GetById(patientId,_specification).Result;
...@@ -60,16 +60,16 @@ namespace ApplicationCore.Services ...@@ -60,16 +60,16 @@ namespace ApplicationCore.Services
return _unitOfWork.Entity.GetById(id) is null ? false : true; 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); 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); 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 ...@@ -8,12 +8,12 @@ namespace ApplicationDomain.Exceptions
{ {
public class DomainException : Exception public class DomainException : Exception
{ {
internal DomainException(string businessMessage) public DomainException(string businessMessage)
: base(businessMessage) : base(businessMessage)
{ {
} }
internal DomainException(string message, Exception innerException) public DomainException(string message, Exception innerException)
: base(message, innerException) : base(message, innerException)
{ {
} }
......
...@@ -5,8 +5,7 @@ using Microsoft.AspNetCore.Identity; ...@@ -5,8 +5,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore; using ApplicationCore.DTOs;
using ApplicationCore.DomainModel;
namespace WebPresentation.Controllers namespace WebPresentation.Controllers
{ {
......
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationCore.Interfaces; using ApplicationCore.Interfaces;
using ApplicationDomain.Entities; using ApplicationDomain.Entities;
using AutoMapper; using AutoMapper;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace WebPresentation.Controllers 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( public CRUDController(
UserManager<User> userManager, UserManager<User> userManager,
IService<T> service IService<TDto> service,
IMapper mapper
) )
:base(userManager) :base(userManager)
{ {
_mapper = mapper;
_service = service; _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); return PartialView(id);
} }
// Post method to edit a medicine
[HttpPost] [HttpPost]
public IActionResult Dummy(int id, string s) public IActionResult DummyPartial(int id, string s)
{ {
return RedirectToAction(nameof(Details),new { Id= id}); return RedirectToAction(nameof(Details),new { Id= id});
} }
...@@ -39,77 +54,78 @@ namespace WebPresentation.Controllers ...@@ -39,77 +54,78 @@ namespace WebPresentation.Controllers
if (id is null) if (id is null)
{ {
return View("NotFound"); return PartialView("_PartialNotFound");
} }
else else
{ {
T TModel = await _service.GetDetails((int)id); TDto DetailDto = await _service.GetDetails((int)id);
if (TModel is null) if (DetailDto is null)
return View("NotFound"); return PartialView("_PartialNotFound");
return View(TModel); TVModel model = _mapper.Map<TVModel>(DetailDto);
return View(model);
} }
} }
public async Task< IActionResult> Delete(int id) 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 View("NotFound");
} }
TVModel model = _mapper.Map<TVModel>(DetailDto);
return PartialView(TModel); return PartialView(model);
} }
public async virtual Task<IActionResult> Index()
{
var s = await _service.GetAll();
return View(s);
}
[HttpPost, ActionName("Delete")] [HttpPost, ActionName("Delete")]
// [ValidateAntiForgeryToken]
public IActionResult DeleteConfirmed(int id) public IActionResult DeleteConfirmed(int id)
{ {
_service.Delete(id); _service.Delete(id);
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
// GET: Projects/Edit/5 [HttpGet]
public IActionResult Edit(int? id) public async Task<IActionResult> Edit(int? id)
{ {
if (id == null) if (id == null)
{ {
return View("NotFound"); return PartialView("_PartialNotFound");
} }
try
T tModel = _service.GetDetails((int)id).Result;
if (tModel == null)
{ {
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] [HttpPost]
[ValidateAntiForgeryToken] [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(); return NotFound();
} }
TDto dto = null;
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
try try
{ {
tModel = _service.Update(tModel); dto = _mapper.Map<TDto>(viewModel);
dto = _service.Update(dto);
} }
catch (DbUpdateConcurrencyException) catch (DbUpdateConcurrencyException)
...@@ -117,9 +133,11 @@ namespace WebPresentation.Controllers ...@@ -117,9 +133,11 @@ namespace WebPresentation.Controllers
return View("Error"); 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() public IActionResult Create()
...@@ -127,22 +145,53 @@ namespace WebPresentation.Controllers ...@@ -127,22 +145,53 @@ namespace WebPresentation.Controllers
return View(); 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] [HttpPost]
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public virtual IActionResult Create(T viewModel, int id) public virtual IActionResult Create(TVModel viewModel, int id)
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
TDto dto = _mapper.Map<TDto>(viewModel);
viewModel= _service.Create(viewModel); dto= _service.Create(dto);
viewModel = _mapper.Map<TVModel>(dto);
return RedirectToAction("Details", new { id = viewModel.Id }); return RedirectToAction("Details", new { id = viewModel.Id });
} }
return View(viewModel); 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 @@ ...@@ -2,15 +2,14 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using WebPresentation.Models; using WebPresentation.Models;
using ApplicationCore.Interfaces.IServices; using ApplicationCore.Interfaces.IServices;
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using AutoMapper;
using WebPresentation.ViewModels;
using System.Threading.Tasks;
namespace WebPresentation.Controllers namespace WebPresentation.Controllers
{ {
...@@ -18,41 +17,36 @@ namespace WebPresentation.Controllers ...@@ -18,41 +17,36 @@ namespace WebPresentation.Controllers
[Authorize(Roles ="patient")] [Authorize(Roles ="patient")]
public class HomeController : BaseController public class HomeController : BaseController
{ {
private readonly IMapper _mapper;
private readonly IPatientService _patientService; private readonly IPatientService _patientService;
public HomeController( public HomeController(
UserManager<User> userManager, UserManager<User> userManager,
IPatientService patientService IPatientService patientService,
IMapper mapper
):base(userManager) ):base(userManager)
{ {
_mapper = mapper;
_patientService = patientService; _patientService = patientService;
} }
private PatientModel _getCurrentPatient() { private async Task<PatientViewModel> getCurrentPatient() {
var u = GetCurrentUser();
var userId = GetUserId();
var patient = _patientService var userId = GetUserId();
.GetAll( var patient =await _patientService.GetByUserId(userId);
).Result return _mapper.Map<PatientViewModel>(patient);
.Where(
u => u.User.Id == userId
)
.FirstOrDefault();
return patient;
} }
public IActionResult Index() public async Task<IActionResult> Index()
{ {
var t =await getCurrentPatient();
return View(_getCurrentPatient()); return View(t);
} }
public IActionResult Details(int? id ) { public IActionResult Details(int? id ) {
return View(_getCurrentPatient()); return View(getCurrentPatient());
} }
......
...@@ -2,31 +2,26 @@ ...@@ -2,31 +2,26 @@
using ApplicationCore.Interfaces.IServices; using ApplicationCore.Interfaces.IServices;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using System.Threading.Tasks; using WebPresentation.ViewModels;
using Microsoft.AspNetCore.Mvc; using AutoMapper;
namespace WebPresentation.Controllers namespace WebPresentation.Controllers
{ {
[Authorize(Roles = "Admin")] [Authorize(Roles = "Admin")]
public class IngredientController : CRUDController<IngredientModel> public class IngredientController : CRUDController<IngredientDTO,IngredientViewModel>
{ {
public IngredientController(UserManager<User> userManager, public IngredientController(
IIngredientService ingredientSercie UserManager<User> userManager,
) : base(userManager,ingredientSercie) 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; ...@@ -3,18 +3,19 @@ using ApplicationCore.Interfaces.IServices;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; 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 namespace WebPresentation.Controllers
{ {
[Authorize(Roles = "patient")] [Authorize(Roles = "patient")]
public class MedicalStateController : CRUDController<MedicalStateModel> public class MedicalStateController : CRUDController<MedicalStateDTO,MedicalStateViewModel>
{ {
private readonly IMedicalStateService _medicalStateService; private readonly IMedicalStateService _medicalStateService;
private readonly IPatientService _patientService; private readonly IPatientService _patientService;
...@@ -24,8 +25,9 @@ namespace WebPresentation.Controllers ...@@ -24,8 +25,9 @@ namespace WebPresentation.Controllers
public MedicalStateController(UserManager<User> userManager, public MedicalStateController(UserManager<User> userManager,
IMedicalStateService medicalStateService , IMedicalStateService medicalStateService ,
IPatientService patientService , IPatientService patientService ,
IMedicineService medicineService IMedicineService medicineService,
) : base(userManager,medicalStateService) IMapper mapper
) : base(userManager,medicalStateService,mapper)
{ {
_medicalStateService = medicalStateService; _medicalStateService = medicalStateService;
_patientService =patientService; _patientService =patientService;
...@@ -34,11 +36,13 @@ namespace WebPresentation.Controllers ...@@ -34,11 +36,13 @@ namespace WebPresentation.Controllers
public async override Task<IActionResult> Index( ) public async override Task<IActionResult> Index( )
{ {
var u = GetUserId();
var p = await _patientService.GetAll(); var u = GetUserId();
var pId= p.Where(p => p.User.Id == u).FirstOrDefault().Id; var p = await _patientService.GetByUserId(u);
var meds =await ((IMedicalStateService )_service).GetAllPatientMedicalStates(pId); var pId= p.Id;
return View(meds); var meds =await ((IMedicalStateService )_service).GetAllPatientMedicalStates(pId);
return View(_mapper.Map<IEnumerable<MedicalStateViewModel>>(meds));
} }
...@@ -46,7 +50,7 @@ namespace WebPresentation.Controllers ...@@ -46,7 +50,7 @@ namespace WebPresentation.Controllers
[HttpPost] [HttpPost]
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public override IActionResult Create(MedicalStateModel medicalState, int id) public override IActionResult Create(MedicalStateViewModel medicalState, int id)
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
...@@ -54,102 +58,93 @@ namespace WebPresentation.Controllers ...@@ -54,102 +58,93 @@ namespace WebPresentation.Controllers
var p = _patientService.GetByUserId(uId).Id; var p = _patientService.GetByUserId(uId).Id;
if (medicalState.PrescriptionTime == DateTime.MinValue ) if (medicalState.PrescriptionTime == DateTime.MinValue )
medicalState.PrescriptionTime = DateTime.Now; 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 RedirectToAction("Details", "MedicalState" , new { Id =n.Id });
} }
return View(medicalState); 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 #region json
[HttpGet] [HttpGet]
public JsonResult GetMedicalStateMedicine(int id) { public async Task<IActionResult> GetMedicalStateMedicine(int id) {
var r = _medicalStateService.GetDetails(id).Result.Medicines; var all = await _medicalStateService.GetDetails(id);
return Json(r); return Ok(new { message = "Succed", result = all.Medicines });
} }
[HttpPost] [HttpPost]
public JsonResult AddMedicine([FromBody]MedicalStateMedicineModel medicalStateMedicineModel) public IActionResult AddMedicine([FromBody]MedicalStateMedicineVModel medicalStateMedicine)
{ {
try try
{ {
var medicalStateMedicineModel = _mapper.Map<MedicalStateMedicineDTO>(medicalStateMedicine);
_medicineService.AddToMedicalState(medicalStateMedicineModel); _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 catch
{ {
return Json("faild"); return NotFound(new { message = "Error ", result = "faild" });
} }
} }
[HttpPost] [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 NotFound(new { message = "Error ", result = "faild" });
return Json("");
return Json(TModel);
} }
} }
[Authorize(Roles = "patient")]
[HttpGet] [HttpGet]
public async Task<IActionResult> GetALLMedicines()
public JsonResult GetMedicines()
{ {
var all = _medicineService.GetAll().Result; var all = await _medicineService.GetAll();
return new JsonResult(all);
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 #endregion json
} }
......
using ApplicationDomain.Entities; using ApplicationDomain.Entities;
using ApplicationCore.Interfaces.IServices; using ApplicationCore.Interfaces.IServices;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using System.Threading.Tasks; using System.Threading.Tasks;
using WebPresentation.ViewModels;
using AutoMapper;
namespace WebPresentation.Controllers namespace WebPresentation.Controllers
{ {
[Authorize(Roles = "Admin")] [Authorize(Roles = "Admin")]
public class MedicineController : CRUDController<MedicineModel> public class MedicineController : CRUDController<MedicineDTO,MedicineViewModel>
{ {
private readonly IIngredientService _ingredientService; private readonly IIngredientService _ingredientService;
public MedicineController(UserManager<User> userManager, public MedicineController(
UserManager<User> userManager,
IMedicineService medicineService , IMedicineService medicineService ,
IIngredientService ingredientService IIngredientService ingredientService,
IMapper mapper
):base(userManager ,medicineService) ):base(userManager ,medicineService,mapper)
{ {
_ingredientService =ingredientService; _ingredientService =ingredientService;
} }
#region json
[Authorize(Roles = "Admin")]
[HttpPost] [HttpPost]
public async Task<IActionResult> ReomveIngredient([FromBody] MedicineIngredientModel medicineIngredientModel) public async Task<IActionResult> ReomveIngredient([FromBody] MedicineIngredientDTO medicineIngredientModel)
{ {
await _ingredientService.RemoveFromMedicine(medicineIngredientModel); await _ingredientService.RemoveFromMedicine(medicineIngredientModel);
return Ok(new {message = "removed" }); return Ok(new {message = "removed" ,result ="Successed"});
} }
[Authorize(Roles = "Admin")]
[HttpPost] [HttpPost]
public async Task<IActionResult> AddIngredints([FromBody] MedicineIngredientModel medicineIngredientModel) public async Task<IActionResult> AddIngredient([FromBody] MedicineIngredientDTO medicineIngredientModel)
{ {
await _ingredientService.AddToMedicine(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 #endregion json
} }
......
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationCore.Interfaces.IServices; using ApplicationCore.Interfaces.IServices;
using ApplicationDomain.Entities; using ApplicationDomain.Entities;
using AutoMapper;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebPresentation.ViewModel.Identity; using WebPresentation.ViewModel.Identity;
using WebPresentation.ViewModels;
namespace WebPresentation.Controllers namespace WebPresentation.Controllers
{ {
[Authorize(Roles ="Admin")] [Authorize(Roles ="Admin")]
public class PatientsController : CRUDController<PatientModel> public class PatientsController : CRUDController<PatientDTO,PatientViewModel>
{ {
public PatientsController(UserManager<User> userManager, public PatientsController(
IPatientService patientService UserManager<User> userManager,
) : base(userManager, patientService) IPatientService patientService,
IMapper mapper
) : base(userManager, patientService,mapper)
{ {
} }
......
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationDomain.Entities; using ApplicationDomain.Entities;
using AutoMapper; using AutoMapper;
using WebPresentation.ViewModels; using WebPresentation.ViewModels;
...@@ -9,25 +9,20 @@ namespace ApplicationCore.Mappere ...@@ -9,25 +9,20 @@ namespace ApplicationCore.Mappere
{ {
public ViewModelObjectMapper() public ViewModelObjectMapper()
{ {
CreateMap<MedicineViewModel, MedicineModel>() CreateMap<MedicineViewModel, MedicineDTO>().ReverseMap();
.ForMember(dest => dest.Category, opt => opt.MapFrom(src => src.Category)) CreateMap<PatientDTO, PatientViewModel>().ReverseMap();
.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<Ingredient, IngredientModel>().ReverseMap(); CreateMap<IngredientViewModel, IngredientDTO>().ReverseMap();
CreateMap<MedicineIngredientDTO, MedicineIngredientViewModel>().ReverseMap();
CreateMap<MedicalStateViewModel, MedicalStateModel>().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 ...@@ -25,6 +25,7 @@ namespace WebPresentation.Midlewares
} }
catch (Exception ex) catch (Exception ex)
{ {
} }
} }
......
...@@ -15,7 +15,7 @@ using Microsoft.Extensions.Hosting; ...@@ -15,7 +15,7 @@ using Microsoft.Extensions.Hosting;
using AutoMapper; using AutoMapper;
using ApplicationDomain.Abstraction; using ApplicationDomain.Abstraction;
using ApplicationDomain.Repositories; using ApplicationDomain.Repositories;
using ApplicationCore.DomainModel; using ApplicationCore.DTOs;
using ApplicationCore.Mapper; using ApplicationCore.Mapper;
using System; using System;
using Microsoft.AspNetCore.Http; 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebPresentation.ViewModels namespace WebPresentation.ViewModels
{ {
...@@ -18,8 +14,8 @@ namespace WebPresentation.ViewModels ...@@ -18,8 +14,8 @@ namespace WebPresentation.ViewModels
public int Price { get; set; } public int Price { get; set; }
public String Image { get; set; } public String Image { get; set; }
public int Dosage { get; set; } public int Dosage { get; set; }
public String Category { get; set; } public CategoryViewModel Category { get; set; }
public String MedicineType { get; set; } public MedicineTypeViewModel MedicineType { get; set; }
public ICollection<IngredientViewModel> Ingredients { get; set; } public ICollection<IngredientViewModel> Ingredients { get; set; }
public ICollection<MedicineIngredientViewModel> MedicineIngredients { 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; ...@@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace WebPresentation.ViewModel namespace WebPresentation.ViewModels
{ {
public class PatientMedicinesViewModel public class PatientMedicinesViewModel
{ {
......
...@@ -15,8 +15,6 @@ namespace WebPresentation.ViewModels ...@@ -15,8 +15,6 @@ namespace WebPresentation.ViewModels
public User User { get; set; } public User User { get; set; }
public String BIO { get; set; } public String BIO { get; set; }
#region Navigations
public ICollection<MedicalStateViewModel> MedicalStates { get; set; } public ICollection<MedicalStateViewModel> MedicalStates { get; set; }
#endregion Navigations
} }
} }
@model PatientModel @model PatientViewModel
......
@model PatientModel @model PatientViewModel
......
 
@using Microsoft.AspNetCore.Identity ; @using Microsoft.AspNetCore.Identity ;
@model PatientModel ; @model PatientViewModel ;
@inject SignInManager<User> SignInManager @inject SignInManager<User> SignInManager
@inject UserManager<User> UserManager @inject UserManager<User> UserManager
......
@model IngredientModel @model IngredientViewModel
@{ @{
ViewData["Title"] = "Create"; ViewData["Title"] = "Create";
......
@model IngredientModel @model IngredientViewModel
@{ @{
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";
...@@ -7,39 +7,37 @@ ...@@ -7,39 +7,37 @@
} }
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5> <h5 class="modal-title" id="modalEditLabel">Delete Ingredient</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> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body container-fluid">
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3> <h3>Are you sure you want to delete this?</h3>
<div> <div>
<h4>Ingredient</h4>
<hr /> <hr />
<dl class="row"> <dl class="row">
<dt class="col-sm-2"> <dt class="col-6">
@Html.DisplayNameFor(model => model.Name) @Html.DisplayNameFor(model => model.Name)
</dt> </dt>
<dd class="col-sm-10"> <dd class="col-6">
@Html.DisplayFor(model => model.Name) @Html.DisplayFor(model => model.Name)
</dd> </dd>
<dt class="col-sm-2"> <dt class="col-6">
@Html.DisplayNameFor(model => model.Description) @Html.DisplayNameFor(model => model.Description)
</dt> </dt>
<dd class="col-sm-10"> <dd class="col-6">
@Html.DisplayFor(model => model.Description) @Html.DisplayFor(model => model.Description)
</dd> </dd>
</dl> </dl>
<hr />
<form asp-action="Delete"> <form asp-action="Delete">
<input type="hidden" asp-for="Id" /> <input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> | <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> </form>
</div> </div>
</div> </div>
\ No newline at end of file
@model IngredientModel @model IngredientViewModel
@{ @{
ViewData["Title"] = "Details"; ViewData["Title"] = "Details";
......
@model IngredientModel; @model IngredientViewModel;
@{ @{
ViewData["Title"] = "Edit"; ViewData["Title"] = "Edit";
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5> <h5 class="modal-title" id="modalEditLabel">Edit Ingredient</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> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
...@@ -32,14 +32,13 @@ ...@@ -32,14 +32,13 @@
<input type="hidden" asp-for="Id" /> <input type="hidden" asp-for="Id" />
<div class="form-group"> <div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" /> <input type="submit" value="Save" class="btn btn-primary" />
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<div>
<a asp-action="Index">Back to List</a>
</div>
</div> </div>
@section Scripts { @section Scripts {
......
@model IEnumerable<IngredientModel> @model IEnumerable<IngredientViewModel>
@{ @{
ViewData["Title"] = "Index"; ViewData["Title"] = "Index";
......
@model IEnumerable<MedicineModel> @model IEnumerable<MedicineViewModel>
@(ViewData["Title"]="Medicines Galary") @(ViewData["Title"]="Medicines Galary")
@{ @{
var t = 0; var t = 0;
......
@model MedicalStateModel @model MedicalStateViewModel
@{ @{
ViewData["Title"] = "Create"; ViewData["Title"] = "Create";
......
@model MedicalStateModel @model MedicalStateViewModel
@{ @{
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
} }
<div class="modal-header"> <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"> <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
...@@ -16,11 +16,9 @@ ...@@ -16,11 +16,9 @@
<div class="container py-5 h-100"> <div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center 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> <h3>Are you sure you want to delete this?</h3>
<div> <div>
<h4>Medical State</h4>
<hr /> <hr />
<dl class="row"> <dl class="row">
<dt class="col-sm-2"> <dt class="col-sm-2">
...@@ -46,7 +44,8 @@ ...@@ -46,7 +44,8 @@
<form asp-action="Delete"> <form asp-action="Delete">
<input type="hidden" asp-for="Id" /> <input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> | <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> </form>
</div> </div>
......
@model MedicalStateModel @model MedicalStateViewModel
@{ @{
ViewData["Title"] = "Medical State Details "; ViewData["Title"] = "Medical Case Details ";
ViewData["Controller"] = "MedicalState"; ViewData["Controller"] = "MedicalState";
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<td>@ing.Dosage</td> <td>@ing.Dosage</td>
<td>@ing.ManufactureName</td> <td>@ing.ManufactureName</td>
<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> <button class="btn btn-primary" onclick="DetailMedicine( @ing.Id)">Details</button>
</td> </td>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<hr /> <hr />
<div class="row pt-1"> <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>
</div> </div>
...@@ -136,9 +136,9 @@ ...@@ -136,9 +136,9 @@
</button> </button>
</div> </div>
<div class="modal-body text-start p-3"> <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" <hr class="mt-2 mb-4"
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;"> style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;">
...@@ -155,10 +155,10 @@ ...@@ -155,10 +155,10 @@
async function fetchMedicines() { async function fetchMedicines() {
try { try {
debugger 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) { if (response.ok) {
let medicines = await response.json(); let medicines = await response.json();
populateTable(medicines, 'medicines-table'); populateTable(medicines.result, 'medicines-table');
} else { } else {
console.error('Error:', response.statusText); console.error('Error:', response.statusText);
} }
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
let response = await fetch(`/MedicalState/GetMedicalStateMedicine/?id=${id}`); // Adjust the endpoint as needed let response = await fetch(`/MedicalState/GetMedicalStateMedicine/?id=${id}`); // Adjust the endpoint as needed
if (response.ok) { if (response.ok) {
let medicines = await response.json(); let medicines = await response.json();
populateTable(medicines, 'Ingredients_'); populateTable(medicines.result, 'Ingredients_');
} else { } else {
console.error('Error:', response.statusText); console.error('Error:', response.statusText);
} }
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
let tableBody = document.querySelector('#' + tableName); let tableBody = document.querySelector('#' + tableName);
tableBody.innerHTML = ` tableBody.innerHTML = `
<table class="table"> <table id="${tableName}" class="table">
<thead> <thead>
<tr class="mb-3"> <tr class="mb-3">
<td>ID</td> <td>ID</td>
...@@ -201,9 +201,9 @@ ...@@ -201,9 +201,9 @@
</td> </td>
</tr> </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 => { medicines.forEach(medicine => {
let row = document.createElement('tr'); let row = document.createElement('tr');
...@@ -224,8 +224,8 @@ ...@@ -224,8 +224,8 @@
` `
<td> <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> </td>
` : ` :
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
async function addMedicine(med) { async function addMedicine(med) {
let id =@Model.Id; let id =@Model.Id;
try { try {
showToast('Loading ... ', 'Adding medicine'); // showToast('Loading ... ', 'Adding medicine');
let response = await fetch(`/MedicalState/AddMedicine`, { let response = await fetch(`/MedicalState/AddMedicine`, {
method: 'POST', method: 'POST',
...@@ -255,9 +255,10 @@ ...@@ -255,9 +255,10 @@
if (response.ok) { if (response.ok) {
let result = await response.json(); let result = await response.json();
updateMedicines(); updateMedicines();
showToast('Medicine added successfully', 'Success'); showToast(result.message, 'Success');
} else { } else {
console.error('Error:', response.statusText); console.error('Error:', response.statusText);
if (response)
showToast('Failed to add medicine', 'Error'); showToast('Failed to add medicine', 'Error');
} }
} catch (error) { } catch (error) {
...@@ -269,7 +270,7 @@ ...@@ -269,7 +270,7 @@
let id =@Model.Id; let id =@Model.Id;
try { try {
debugger debugger
let response = await fetch(`/MedicalState/GetDetails/${med}`, { let response = await fetch(`/MedicalState/GetMedicineDetails/${med}`, {
method: 'GET', method: 'GET',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
...@@ -279,7 +280,7 @@ ...@@ -279,7 +280,7 @@
if (response.ok) { if (response.ok) {
let result = await response.json(); let result = await response.json();
console.log(result) console.log(result)
showModal('Medicine Details',result ); showModal('Medicine Details', result.result);
} else { } else {
console.error('Error:', response.statusText); console.error('Error:', response.statusText);
showToast('Failed to add medicine', 'Error'); showToast('Failed to add medicine', 'Error');
...@@ -318,32 +319,6 @@ ...@@ -318,32 +319,6 @@
showToast('Failed to remove medicine', 'Error'); 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) { async function DeleteConfirm(title, message, action,param) {
debugger debugger
const modalBody = document.querySelector('#item-container'); const modalBody = document.querySelector('#item-container');
...@@ -368,7 +343,7 @@ ...@@ -368,7 +343,7 @@
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;"> 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"> <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> <button class="btn btn-info" class="close" data-dismiss="modal" aria-label="Close">Close</button>
</div> </div>
...@@ -381,11 +356,11 @@ ...@@ -381,11 +356,11 @@
} }
function showToast(message, title) { function showToast(message, title) {
const Modal = bootstrap.Modal.getInstance(document.getElementById('item')); // const Modal = bootstrap.Modal.getInstance(document.getElementById('item'));
// Modal.close(); // Modal.close();
// if (Modal) Modal.hide(); // if (Modal) Modal.hide();
// Modal.toggle(); // Modal.toggle();
Modal.dispose(); // Modal.dispose();
const emedicineModal = new bootstrap.Modal(document.getElementById('item')); const emedicineModal = new bootstrap.Modal(document.getElementById('item'));
emedicineModal.hide(); emedicineModal.hide();
const modalBody = document.querySelector('#item-container'); const modalBody = document.querySelector('#item-container');
......
@model MedicalStateModel @model MedicalStateViewModel
@{ @{
ViewData["Title"] = "Edit"; ViewData["Title"] = "Edit";
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5> <h5 class="modal-title" id="modalEditLabel">Edit Medical Case</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> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
...@@ -42,14 +42,13 @@ ...@@ -42,14 +42,13 @@
<div class="form-group"> <div class="form-group">
<input hidden value="@ViewBag.id" name="pId" /> <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" /> <input type="submit" value="Save" class="btn btn-primary" />
</div> </div>
<input hidden value="@Model.PatientId" asp-for="@Model.PatientId" /> <input hidden value="@Model.PatientId" asp-for="@Model.PatientId" />
</form> </form>
<a asp-action="Index">Back to List</a>
</div> </div>
......
@model IEnumerable<MedicalStateModel>; @model IEnumerable<MedicalStateViewModel>;
@{ @{
ViewData["Title"] = "Medical states "; ViewData["Title"] = "Medical states ";
......
@model IEnumerable<IngredientModel> @model IEnumerable<IngredientViewModel>
@{ @{
} }
<section class="page-section p-5 m-5"> <section class="page-section p-5 m-5">
......
@model MedicineModel @model MedicineViewModel
@{ @{
ViewData["Title"] = "Create"; ViewData["Title"] = "Create";
......
@model MedicineModel @model MedicineViewModel
@{ @{
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";
...@@ -8,50 +8,57 @@ ...@@ -8,50 +8,57 @@
} }
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5> <h5 class="modal-title" id="modalEditLabel">Delete 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> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3> <h3>Are you sure you want to delete this?</h3>
<div>
<h4>Medicine</h4> <hr />
<hr /> <dl class="row">
<dl class="row"> <dt class="col">
<dt class="col-sm-2"> @Html.DisplayNameFor(model => model.TradeName)
@Html.DisplayNameFor(model => model.TradeName) </dt>
</dt> <dd class="col">
<dd class="col-sm-10"> @Html.DisplayFor(model => model.TradeName)
@Html.DisplayFor(model => model.TradeName) </dd>
</dd> </dl>
<dt class="col-sm-2"> <dl>
@Html.DisplayNameFor(model => model.Description) <dt class="col">
</dt> @Html.DisplayNameFor(model => model.Description)
<dd class="col-sm-10"> </dt>
@Html.DisplayFor(model => model.Description) <dd class="col">
</dd> @Html.DisplayFor(model => model.Description)
<dt class="col-sm-2"> </dd>
@Html.DisplayNameFor(model => model.Category.Name)
</dt> </dl>
<dd class="col-sm-10"> <dl>
@Html.DisplayFor(model => model.Category.Name) <dt class="col">
</dd> @Html.DisplayNameFor(model => model.Category.Name)
<dt class="col-sm-2"> </dt>
@Html.DisplayNameFor(model => model.Price) <dd class="col">
</dt> @Html.DisplayFor(model => model.Category.Name)
<dd class="col-sm-10"> </dd>
@Html.DisplayFor(model => model.Price)
</dd> </dl>
</dl> <dl>
<dt class="col">
<form asp-action="Delete"> @Html.DisplayNameFor(model => model.Price)
<input type="hidden" asp-for="Id" /> </dt>
<input type="submit" value="Delete" class="btn btn-danger" /> | <dd class="col">
<a asp-action="Index">Back to List</a> @Html.DisplayFor(model => model.Price)
</form> </dd>
</div> </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> </div>
\ No newline at end of file
@model MedicineModel @model MedicineViewModel
@{ @{
ViewData["Title"] = "Medicine Details "; ViewData["Title"] = "Medicine Details ";
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<td>@ing.Ingredient.Description</td> <td>@ing.Ingredient.Description</td>
<td>@ing.Ratio</td> <td>@ing.Ratio</td>
<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> </td>
</tr> </tr>
...@@ -109,11 +109,11 @@ ...@@ -109,11 +109,11 @@
async function fetchAll() { async function fetchAll() {
try { try {
debugger 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) { if (response.ok) {
let medicines = await response.json(); let medicines = await response.json();
// showModal('',medicines); // showModal('',medicines);
populateTable(medicines,'t') populateTable(medicines.result,'t')
} else { } else {
console.error('Error:', response.statusText); console.error('Error:', response.statusText);
showToast(medicines, 'error'); showToast(medicines, 'error');
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
let id =@Model.Id; let id =@Model.Id;
debugger; debugger;
try { 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) { if (response.ok) {
let medicines = await response.json(); let medicines = await response.json();
medicines = medicines.medicineIngredients medicines = medicines.medicineIngredients
...@@ -173,11 +173,12 @@ ...@@ -173,11 +173,12 @@
` `
<td> <td>
<button class="btn btn-danger" ondblclick="ReomveIngredient(${medicine.id})">Delete</button> <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>
` : ` :
`<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> </td>
` `
...@@ -211,7 +212,9 @@ ...@@ -211,7 +212,9 @@
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;"> 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"> <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> </div>
</div> </div>
...@@ -228,7 +231,7 @@ ...@@ -228,7 +231,7 @@
var r = document.getElementById('r').value; var r = document.getElementById('r').value;
console.log(r) console.log(r)
let response = await fetch(`/Medicine/AddIngredints`, { let response = await fetch(`/Medicine/AddIngredient`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
...@@ -327,7 +330,7 @@ ...@@ -327,7 +330,7 @@
style="height: 0; background-color: transparent; opacity: .75; border-top: 2px dashed #9e9e9e;"> 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"> <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> <button class="btn btn-info" class="close" data-dismiss="modal" aria-label="Close">Close</button>
</div> </div>
......
@model MedicineModel; @model MedicineViewModel;
@*@{ @*@{
ViewData["Title"] = "Edit"; ViewData["Title"] = "Edit";
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
}*@ }*@
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="modalEditLabel">Edit Medicine</h5> <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> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col "> <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" /> <input asp-for="Category.Name" class="form-control" />
<span asp-validation-for="Category.Name" class="text-danger"></span> <span asp-validation-for="Category.Name" class="text-danger"></span>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<input type="hidden" asp-for="Id" /> <input type="hidden" asp-for="Id" />
<div class="form-group"> <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" /> <input type="submit" value="Save" class="btn btn-primary" />
</div> </div>
......
@model IEnumerable<MedicineModel>; @model IEnumerable<MedicineViewModel>;
@{ @{
ViewData["Title"] = "Index"; ViewData["Title"] = "Index";
......
...@@ -201,7 +201,6 @@ ...@@ -201,7 +201,6 @@
}); });
</script> </script>
<!-- Bootstrap core JavaScript --> <!-- Bootstrap core JavaScript -->
<script src="~/js/jquery.min.js"></script> <script src="~/js/jquery.min.js"></script>
<script src="~/js/bootstrap.bundle.min.js"></script> <script src="~/js/bootstrap.bundle.min.js"></script>
...@@ -210,5 +209,7 @@ ...@@ -210,5 +209,7 @@
<script src="~/js/jquery.easing.min.js"></script> <script src="~/js/jquery.easing.min.js"></script>
<!-- Custom scripts for this template --> <!-- Custom scripts for this template -->
<script src="~/js/freelancer.min.js"></script>
<!-- Custom scripts for this template -->
</body> </body>
</html> </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
@using WebPresentation.Models @using WebPresentation.ViewModels
@using ApplicationCore.DomainModel; @using ApplicationDomain.Entities
@using ApplicationDomain.Entities; @using ApplicationCore.DTOs
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using System @using System
\ No newline at end of file
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
<ItemGroup> <ItemGroup>
<Folder Include="Filters\" /> <Folder Include="Filters\" />
<Folder Include="Services Consumers\" />
<Folder Include="Views\Patients\" /> <Folder Include="Views\Patients\" />
</ItemGroup> </ItemGroup>
......
...@@ -20,21 +20,21 @@ using WebPresentation; ...@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models; using WebPresentation.ViewModels;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel; using ApplicationDomain.Entities;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities; using ApplicationCore.DTOs;
#line default #line default
#line hidden #line hidden
...@@ -47,7 +47,7 @@ using System; ...@@ -47,7 +47,7 @@ using System;
#line hidden #line hidden
#nullable disable #nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"d8ddb6bffa5a9b264bf8f89038bf03c234083fd3", @"/Views/Home/Privacy.cshtml")] [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> public class Views_Home_Privacy : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
{ {
#pragma warning disable 1998 #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/> // <auto-generated/>
#pragma warning disable 1591 #pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Ingredient_Details), @"mvc.1.0.view", @"/Views/Ingredient/Details.cshtml")] [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; ...@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models; using WebPresentation.ViewModels;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel; using ApplicationDomain.Entities;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities; using ApplicationCore.DTOs;
#line default #line default
#line hidden #line hidden
...@@ -46,9 +46,9 @@ using System; ...@@ -46,9 +46,9 @@ using System;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"03da15210833c5aaf63a9787f6d01d7625911299", @"/Views/Ingredient/Details.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"a408e525829337b77ae58353a38e63ed6e3b9e4e", @"/Views/Ingredient/Details.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_Ingredient_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IngredientModel> 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_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); 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; ...@@ -100,7 +100,7 @@ using System;
<div class=""col-md-4 gradient-custom text-center text-black"" <div class=""col-md-4 gradient-custom text-center text-black""
style=""border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;""> style=""border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;"">
"); ");
__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>(); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
...@@ -141,7 +141,7 @@ using System; ...@@ -141,7 +141,7 @@ using System;
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\">Delete</button>\r\n\r\n "); 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 "); WriteLiteral("\r\n\r\n <i class=\"far fa-backward\">\r\n\r\n </i>\r\n ");
} }
); );
...@@ -225,7 +225,7 @@ using System; ...@@ -225,7 +225,7 @@ using System;
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [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 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/> // <auto-generated/>
#pragma warning disable 1591 #pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Ingredient_Index), @"mvc.1.0.view", @"/Views/Ingredient/Index.cshtml")] [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; ...@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models; using WebPresentation.ViewModels;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel; using ApplicationDomain.Entities;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities; using ApplicationCore.DTOs;
#line default #line default
#line hidden #line hidden
...@@ -46,9 +46,9 @@ using System; ...@@ -46,9 +46,9 @@ using System;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"078449fe7e30ff1d0badd82e8a5b99967e499556", @"/Views/Ingredient/Index.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"fa65c3d050990672a6d64428d63e48b961383d29", @"/Views/Ingredient/Index.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_Ingredient_Index : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<IngredientModel>> 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_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); 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; ...@@ -105,7 +105,7 @@ using System;
#line hidden #line hidden
#nullable disable #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 "); 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"); WriteLiteral("Create New");
} }
); );
...@@ -217,7 +217,7 @@ using System; ...@@ -217,7 +217,7 @@ using System;
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\">Delete</button>\r\n\r\n "); 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>"); WriteLiteral("<i class=\"far fa-address-card\"></i>");
} }
); );
...@@ -269,7 +269,7 @@ using System; ...@@ -269,7 +269,7 @@ using System;
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [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 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/> // <auto-generated/>
#pragma warning disable 1591 #pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_AddIngredints), @"mvc.1.0.view", @"/Views/Medicine/AddIngredints.cshtml")] [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; ...@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models; using WebPresentation.ViewModels;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel; using ApplicationDomain.Entities;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities; using ApplicationCore.DTOs;
#line default #line default
#line hidden #line hidden
...@@ -46,9 +46,9 @@ using System; ...@@ -46,9 +46,9 @@ using System;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"17e165cd546d9b403ea75a1b085b72fcd2359e67", @"/Views/Medicine/AddIngredints.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"29670b936c66297cbf587d3a06248a14ad551381", @"/Views/Medicine/AddIngredints.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_Medicine_AddIngredints : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<IngredientModel>> 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_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("form-select custom-select"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString(" "), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_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; ...@@ -82,9 +82,9 @@ using System;
public async override global::System.Threading.Tasks.Task ExecuteAsync() public async override global::System.Threading.Tasks.Task ExecuteAsync()
{ {
WriteLiteral("<section class=\"page-section p-5 m-5\">\r\n "); 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 "); 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"); WriteLiteral("\r\n");
#nullable restore #nullable restore
#line 15 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml" #line 15 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
...@@ -95,7 +95,7 @@ using System; ...@@ -95,7 +95,7 @@ using System;
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral(" "); 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 #nullable restore
#line 17 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml" #line 17 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml"
Write(i.Name); Write(i.Name);
...@@ -156,10 +156,10 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For = ModelExpressionProvi ...@@ -156,10 +156,10 @@ __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.For = ModelExpressionProvi
Write(__tagHelperExecutionContext.Output); Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End(); __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"); 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 #nullable restore
#line 25 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\Medicine\AddIngredints.cshtml" #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 default
#line hidden #line hidden
...@@ -196,7 +196,7 @@ WriteAttributeValue("", 691, ViewBag.MedicineId, 691, 19, false); ...@@ -196,7 +196,7 @@ WriteAttributeValue("", 691, ViewBag.MedicineId, 691, 19, false);
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [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 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/> // <auto-generated/>
#pragma warning disable 1591 #pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Medicine_Index), @"mvc.1.0.view", @"/Views/Medicine/Index.cshtml")] [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; ...@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models; using WebPresentation.ViewModels;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel; using ApplicationDomain.Entities;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities; using ApplicationCore.DTOs;
#line default #line default
#line hidden #line hidden
...@@ -46,9 +46,9 @@ using System; ...@@ -46,9 +46,9 @@ using System;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"ef68d88abaade8de74ca3f2f4ef6df3304c3414b", @"/Views/Medicine/Index.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"7313ad17be51b480fe4e1dd7b62733fb02c877b8", @"/Views/Medicine/Index.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_Medicine_Index : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<IEnumerable<MedicineModel>> 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_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); 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; ...@@ -105,10 +105,10 @@ using System;
#line hidden #line hidden
#nullable disable #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"); 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(); EndWriteAttribute();
WriteLiteral("></i>\r\n Medicines Details\r\n <p>\r\n "); 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"); WriteLiteral("Create New");
} }
); );
...@@ -258,7 +258,7 @@ using System; ...@@ -258,7 +258,7 @@ using System;
#line hidden #line hidden
#nullable disable #nullable disable
WriteLiteral("\">Delete</button>\r\n\r\n "); 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>"); WriteLiteral("<i class=\"far fa-address-card\"></i>");
} }
); );
...@@ -310,7 +310,7 @@ using System; ...@@ -310,7 +310,7 @@ using System;
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] [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 #pragma warning restore 1591
...@@ -20,21 +20,21 @@ using WebPresentation; ...@@ -20,21 +20,21 @@ using WebPresentation;
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 2 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using WebPresentation.Models; using WebPresentation.ViewModels;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 3 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationCore.DomainModel; using ApplicationDomain.Entities;
#line default #line default
#line hidden #line hidden
#nullable disable #nullable disable
#nullable restore #nullable restore
#line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml" #line 4 "C:\Users\HASAN\Desktop\Medic\WebPresentation\Views\_ViewImports.cshtml"
using ApplicationDomain.Entities; using ApplicationCore.DTOs;
#line default #line default
#line hidden #line hidden
...@@ -47,7 +47,7 @@ using System; ...@@ -47,7 +47,7 @@ using System;
#line hidden #line hidden
#nullable disable #nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"c4eee3f4993d74b115dec849687defce31fb03ba", @"/Views/Shared/Error.cshtml")] [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> public class Views_Shared_Error : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
{ {
#pragma warning disable 1998 #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