Exemple #1
0
 public List <UtilityModel <uint> > GetMedicalTypes()
 {
     using (var db = DB.GetContext())
     {
         return(MedicalTypeRepository.GetMedicalTypes(db)
                .Select(m => new UtilityModel <uint>(m.MedTypeID, m.MedTypeName))
                .ToList());
     }
 }
Exemple #2
0
        public JsonResult GetMedicalType()
        {
            List <MedicalType> medicaltype;

            using (MedicalTypeRepository repository = new MedicalTypeRepository())
            {
                medicaltype = repository.GetAll().ToList();
            }
            if (medicaltype == null)
            {
                return(Json(HttpNotFound(), JsonRequestBehavior.AllowGet));
            }

            List <MedicalType> onlyMedicalType = new List <MedicalType>();

            //  patients.ForEach(corePatient => onlyPatients.Add(MapToClientObject(corePatient)));
            medicaltype.ForEach(c => onlyMedicalType.Add(new MedicalType
            {
                Id   = c.Id,
                Name = c.Name,
            }));

            return(Json(onlyMedicalType, JsonRequestBehavior.AllowGet));
        }