public async Task <IEnumerable <Chamber> > GetChambers()
        {
            var chambers = await _repo.GetT();

            foreach (var chamber in chambers)
            {
                chamber.Doctor = await doc_Repo.GetTById(chamber.DoctorId);

                chamber.Doctor.Chambers = null;
            }
            return(chambers);
        }
Example #2
0
        public async Task <IEnumerable <Pateint> > GetPateints()
        {
            var pateints = await _repo.GetT();

            foreach (var pateint in pateints)
            {
                pateint.Gender = await gn_Repo.GetTById(pateint.GenderId);

                pateint.Gender.Doctors = null;
            }
            return(pateints);
        }
        public async Task <IEnumerable <DeasisHistory> > GetDeasisHistories()
        {
            var deasisHistories = await _repo.GetT();

            foreach (var deasishist in deasisHistories)
            {
                deasishist.Pateint = await pat_Repo.GetTById(deasishist.PateintId);

                deasishist.Pateint.DeasisHistories = null;
            }
            return(deasisHistories);
        }
        public async Task <IEnumerable <RoasterOfDoctor> > GetRoasters()
        {
            var roasters = await _repo.GetT();

            foreach (var roaster in roasters)
            {
                roaster.Chamber = await _chRepo.GetTById(roaster.ChamberId);

                roaster.Chamber.RoasterOfDoctors = null;
                //roaster.Doctor = await _docRepo.GetTById(roaster.DoctorId);
                //roaster.Doctor.RoasterOfDoctors = null;
            }
            return(roasters);
        }
        public async Task <ActionResult> GetSpeacializations([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var speacialization = await _repo.GetTById(id);

            if (speacialization == null)
            {
                return(NotFound());
            }
            return(Ok(speacialization));
        }
Example #6
0
        public async Task <IEnumerable <Doctor> > GetDoctors()
        {
            var doctors = await _repo.GetT();

            foreach (var doctor in doctors)
            {
                doctor.Speacialization = await sp_Repo.GetTById(doctor.SpeacializationId);

                doctor.Speacialization.Doctors = null;
                doctor.Gender = await gn_Repo.GetTById(doctor.GenderId);

                doctor.Gender.Doctors = null;
            }
            return(doctors);
        }
        public async Task <ActionResult> GetChambers([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var chamber = await _repo.GetTById(id);

            if (chamber == null)
            {
                return(NotFound());
            }
            chamber.Doctor = await doc_Repo.GetTById(chamber.DoctorId);

            chamber.Doctor.Chambers = null;
            return(Ok(chamber));
        }
Example #8
0
        public async Task <ActionResult> GetPateints([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var pateint = await _repo.GetTById(id);

            if (pateint == null)
            {
                return(NotFound());
            }
            pateint.Gender = await gn_Repo.GetTById(pateint.GenderId);

            pateint.Gender.Pateints = null;
            return(Ok(pateint));
        }
        public async Task <ActionResult> GetDeasisHistories([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var deasishist = await _repo.GetTById(id);

            if (deasishist == null)
            {
                return(NotFound());
            }
            deasishist.Pateint = await pat_Repo.GetTById(deasishist.PateintId);

            deasishist.Pateint.DeasisHistories = null;
            return(Ok(deasishist));
        }
        public async Task <ActionResult> GetRoasters([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var roaster = await _repo.GetTById(id);

            if (roaster == null)
            {
                return(NotFound());
            }
            roaster.Chamber = await _chRepo.GetTById(roaster.ChamberId);

            roaster.Chamber.RoasterOfDoctors = null;
            //roaster.Doctor = await _docRepo.GetTById(roaster.DoctorId);
            //roaster.Doctor.RoasterOfDoctors = null;
            return(Ok(roaster));
        }
Example #11
0
        public async Task <ActionResult> GetDoctors([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var doctor = await _repo.GetTById(id);

            if (doctor == null)
            {
                return(NotFound());
            }
            doctor.Speacialization = await sp_Repo.GetTById(doctor.SpeacializationId);

            doctor.Speacialization.Doctors = null;
            doctor.Gender = await gn_Repo.GetTById(doctor.GenderId);

            doctor.Gender.Doctors = null;
            return(Ok(doctor));
        }