Exemple #1
0
    public ActionResult Create()
    {
        DoctorHospitalViewModel viewModel = new DoctorHospitalViewModel
        {
            Hospitals = hospitalRepository.GetAll()
        };

        return(View(viewModel));
    }
Exemple #2
0
        public Secretary GetEager(UserID id)
        {
            var secretary  = GetByID(id);
            var timetables = _timeTableRepository.GetAll();

            secretary.TimeTable = GetTimeTableById(secretary.TimeTable, timetables);
            var hospitals = _hospitalRepository.GetAll();

            secretary.Hospital = GetHospitalById(secretary.Hospital, hospitals);
            return(secretary);
        }
        public Manager GetEager(UserID id)
        {
            var manager = GetByID(id);

            var timetables = _timeTableRepository.GetAll();

            manager.TimeTable = GetTimeTableById(manager.TimeTable, timetables);

            var hospitals = _hospitalRepository.GetAll();

            manager.Hospital = GetHospitalById(manager.Hospital, hospitals);

            return(manager);
        }
Exemple #4
0
 public void UpdateListBox1()
 {
     repository = new HospitalRepository();
     listBox1.Items.Clear();
     foreach (Doctor doctor in repository.GetAll())
     {
         listBox1.Items.Add(doctor);
     }
 }
Exemple #5
0
        public Doctor GetEager(UserID id)
        {
            var doctor = GetByID(id);

            var hospitals = _hospitalRepository.GetAll();

            doctor.Hospital = GetHospitalById(doctor.Hospital, hospitals);

            var timetables = _timeTableRepository.GetAll();

            doctor.TimeTable = GetTimeTableById(doctor.TimeTable, timetables);

            var rooms = _roomRepository.GetAll();

            doctor.Office = GetOfficeById(doctor.Office, rooms);

            return(doctor);
        }
Exemple #6
0
 public List <HospitalDTO> GetAllHospitals()
 {
     try
     {
         List <HospitalDTO>     hospitalDTOList = new List <HospitalDTO>();
         IEnumerable <Hospital> hospitalDTO     = _hospitalRepository.GetAll();
         foreach (var hospital in hospitalDTO)
         {
             var objhospitalDTO = ConvertTODTO(hospital);
             hospitalDTOList.Add(objhospitalDTO);
         }
         return(hospitalDTOList);
     }
     catch (Exception ex)
     {
         log.ErrorFormat("Exception occured while retreiving list of Hospital  Details Info Ex:{0}", ex.Message);
         return(null);
     }
 }
Exemple #7
0
        public async Task <IActionResult> GetAll([FromServices] IHospitalRepository repository)
        {
            var result = await repository.GetAll();

            return(Ok(_mapper.Map <IEnumerable <HospitalViewModel> >(result)));
        }
Exemple #8
0
 public IEnumerable <Hospital> GetAll()
 {
     return(_hospitalRepository.GetAll());
 }
Exemple #9
0
        public async Task <IEnumerable <Hospital> > GetAll()
        {
            var response = await _hospitalRepository.GetAll();

            return(response);
        }