// GET: HospitalController
        public ActionResult Index()
        {
            var hospital = _hospitalService.GetHospitals();

            _logger.LogInformation("All hospitals were listed!");
            return(View(hospital));
        }
Пример #2
0
        // GET: PatientController/Create
        public ActionResult Create()
        {
            var hospitals = _hospitalService.GetHospitals();
            var dropdown  = _patientService.hospitalList(hospitals);

            ViewBag.hospitalList = dropdown;

            return(View());
        }
Пример #3
0
        public IActionResult GetHospitals()
        {
            var re = _IHospitalService.GetHospitals();

            if (re == null)
            {
                return(NotFound());
            }
            return(Ok(re));
        }
Пример #4
0
 public IHttpActionResult Get(int?id = null)
 {
     if (id.HasValue)
     {
         var hospital = _hospitalService.GetHospital(id.Value);
         return(Ok(hospital));
     }
     else
     {
         var hospitals = _hospitalService.GetHospitals();
         return(Ok(hospitals));
     }
 }
Пример #5
0
        public IActionResult Index()
        {
            List <HospitalViewModel> model = new List <HospitalViewModel>();



            _hospitalService.GetHospitals().ToList().ForEach(c =>
            {
                HospitalViewModel hospital = new HospitalViewModel
                {
                    HospitalId          = c.Id,
                    HospitalName        = c.HospitalName,
                    HospitalAddress     = c.HospitalAddress,
                    HospitalPhoneNumber = c.HospitalPhoneNumber,
                    CountryId           = c.CountryId,
                    CountryfalfPath     = string.Format("{0}{1}", _countryService.GetCountrybyId(c.CountryId).Select(x => x.TwoLetterIsoCode.Trim()).First().ToLower(), ".png"),
                    CountryName         = _countryService.GetCountrybyId(c.CountryId).Select(x => x.Name).First()
                };
                model.Add(hospital);
            });

            return(View(model));
        }
Пример #6
0
 public void OnGet()
 {
     Hospitals = hospitalService.GetHospitals();
 }