public List <AlergiasDomainModel> GetMedicamentos() { List <AlergiasDomainModel> alergias = null; alergias = alergiaRepository.GetAll().Where(p => p.idTipoAlergia == 3).Select(p => new AlergiasDomainModel { IdAlergia = p.idAlergias, StrDescripcion = p.strDescripcion }).ToList <AlergiasDomainModel>(); AlergiasDomainModel alergiasDM = new AlergiasDomainModel(); alergiasDM.IdAlergia = 0; alergiasDM.StrDescripcion = "--Seleccionar--"; alergias.Insert(0, alergiasDM); return(alergias); }
public AlergiasDomainModel GetAlergia(int idAlergia, int idPersona) { AlergiasDomainModel alergiasDM = new AlergiasDomainModel(); Expression <Func <tblAlergiasPersonal, bool> > predicado = p => p.idPersonal.Equals(idPersona) && p.idAlergia.Equals(idAlergia); tblAlergiasPersonal tblAlergias = alergiasPersonalRepository.GetAll(predicado).FirstOrDefault <tblAlergiasPersonal>(); alergiasDM.IdAlergia = tblAlergias.catAlergias.idAlergias; alergiasDM.IdtipoAlergia = tblAlergias.catAlergias.idTipoAlergia; alergiasDM.StrDescripcion = tblAlergias.catAlergias.strDescripcion; alergiasDM.StrObservacion = tblAlergias.catAlergias.strObservacion; return(alergiasDM); }
public ActionResult GetAlegiaById(int idAlergia) { int idPersonal = SessionPersister.AccountSession.IdPersonal; //AlergiasPersonalDomainModel alergiasPersonalDM = alergiasPersonalBussines.GetAlergiasPersonales(idAlergia, idPersonal); AlergiasDomainModel alergiasDM = alergiasBusiness.GetAlergia(idAlergia, idPersonal); if (alergiasDM != null) { AlergiasVM alergiasVM = new AlergiasVM(); AutoMapper.Mapper.Map(alergiasDM, alergiasVM); return(PartialView("_Eliminar", alergiasVM)); } return(View()); }
/// <summary> /// Este metodo obtiene las alergias de la persona /// </summary> /// <param name="_idPersonal"></param> /// <returns>una lista con las alergias</returns> public List <AlergiasDomainModel> GetAlergiasByIdPersonal(int _idPersonal) { List <AlergiasDomainModel> alergiasDM = new List <AlergiasDomainModel>(); Expression <Func <tblAlergiasPersonal, bool> > predicado = p => p.idPersonal.Equals(_idPersonal); List <tblAlergiasPersonal> alergias = alergiasPersonalRepository.GetAll(predicado).ToList <tblAlergiasPersonal>(); foreach (tblAlergiasPersonal alergia in alergias) { AlergiasDomainModel alergiaDM = new AlergiasDomainModel(); alergiaDM.IdAlergia = alergia.catAlergias.idAlergias; alergiaDM.IdtipoAlergia = alergia.catAlergias.idTipoAlergia; alergiaDM.StrDescripcion = alergia.catAlergias.strDescripcion; alergiaDM.StrObservacion = alergia.catAlergias.strObservacion; alergiasDM.Add(alergiaDM); } return(alergiasDM); }