/// <see cref="GAP.Appointments.Core.Repository.IEmployeeRepository.GetPacientInfo(string)"
        public async Task <PacientTO> GetPacientInfo(string IdPacient)
        {
            //Get employees list from data source
            PacientTO Pacient = await AppointmentDAO.GetPacientInfo(IdPacient);

            return(Pacient);
        }
        public async Task <PacientTO> GetPacientInfo(string IdPacient)
        {
            PacientTO PacienteInfoByPacient = new PacientTO();

            using (AppointmentsEntities dbContext = new AppointmentsEntities())
            {
                PacienteInfoByPacient = await dbContext.Pacients.Where(x => x.Id == IdPacient).ProjectTo <PacientTO>().FirstOrDefaultAsync();
            }
            return(PacienteInfoByPacient);
        }
Exemple #3
0
        public void GetInfoPacientByPacient()
        {
            //token
            RestClient client;
            string     appointmentServiceUrl = ConfigurationManager.AppSettings["APIRoot"];

            client = new RestClient(appointmentServiceUrl);

            var request = new RestRequest("GetPacientInfo", Method.GET);

            request.AddQueryParameter("IdPacient", "Berbuscar"); // aplica para cada estacion, etiqueta, parametro

            // execute the request
            IRestResponse response = client.ExecuteAsGet(request, "GET");

            PacientTO Pacient = JsonConvert.DeserializeObject <PacientTO>(response.Content);

            Assert.IsNotNull(Pacient);
            Assert.IsNotNull(Pacient.Name);
        }
        public async Task <IHttpActionResult> GetPacientInfo(string IdPacient)
        {
            PacientTO PacientInfo = await _repository.GetPacientInfo(IdPacient);

            return(Ok(PacientInfo));
        }