コード例 #1
0
        public HttpResponseMessage GetHospitalDetail(string hospitalid)
        {
            List <HospitalDetails> hospitals = _hospitaldetailsRepo.Find(x => x.HospitalId == hospitalid);

            var             hospitalService  = _hospitalServicesRepository.GetAll().OrderBy(x => x.HospitalServices).ToList();
            var             hospitalAmenitie = _hospitalAmenitieRepository.GetAll().OrderBy(x => x.HospitalAmenities).ToList();
            var             disease          = _hospitalSpecialtiesRepo.GetAll().OrderBy(x => x.HospitalSpecialties).ToList();
            Hospital        _hospital        = new Hospital();
            List <Hospital> _hospitals       = new List <Hospital>();

            foreach (var h in hospitals ?? new List <HospitalDetails>())
            {
                var feedback = _feedbackRepo.Find(x => x.PageId == h.HospitalId);

                _hospital = new Hospital
                {
                    HospitalId        = h.HospitalId,
                    HospitalName      = h.HospitalName,
                    Mobile            = h.Mobile,
                    AlternateNumber   = h.AlternateNumber,
                    Email             = h.Email,
                    Website           = h.Website,
                    EstablishYear     = h.EstablishYear,
                    NumberofBed       = h.NumberofBed,
                    NumberofAmbulance = h.NumberofAmbulance,
                    PaymentType       = h.PaymentType,
                    Emergency         = h.Emergency,
                    FacilityId        = h.FacilityId,
                    JobType           = h.jobType,
                    Address           = h.Address,
                    Street            = h.Street,
                    Country           = h.Country,
                    City               = h.City,
                    PostCode           = h.PostCode,
                    Landmark           = h.Landmark,
                    AboutUs            = h.AboutUs,
                    InsuranceCompanies = h.InsuranceCompanies,

                    // AmenitiesIds = Array.ConvertAll(h.Amenities.Split(','), s => int.Parse(s)),
                    Amenities = getHospitalAmenities(h.Amenities, hospitalAmenitie),
                    // ServicesIds = Array.ConvertAll(h.Services.Split(','), s => int.Parse(s)),
                    Services         = getHospitalService(h.Services, hospitalService),
                    Specialization   = getHospitalSpecialization(h.Specialization, disease),
                    Doctors          = getDoctors(h.HospitalId),
                    Secretary        = getSecretary(h.HospitalId),
                    Likes            = feedback.Where(x => x.ILike == true).Count(),
                    Feedbacks        = feedback.Count(),
                    BookingUrl       = $"booking/{h.HospitalId}",
                    ProfileDetailUrl = $"hospitalDetails/{h.HospitalId}",
                    ImgUrl           = $"{constant.imgUrl}/ProfilePic/Hospital/{h.HospitalId}.Jpeg"
                };

                _hospitals.Add(_hospital);
            }
            return(Request.CreateResponse(HttpStatusCode.Accepted, _hospitals));
        }
コード例 #2
0
        public List <TblHospitalSpecialties> HospitalSpecialization()
        {
            ITblHospitalSpecialtiesRepository _stateRepository = RepositoryFactory.Create <ITblHospitalSpecialtiesRepository>(ContextTypes.EntityFramework);

            return(_stateRepository.GetAll().OrderBy(x => x.HospitalSpecialties).ToList());
        }