コード例 #1
0
        public List <ExpedienteSalud> CHU_Expediente_Salud_Consultar(ExpedienteSalud Expediente)
        {
            List <ExpedienteSalud> oList = new List <ExpedienteSalud>();

            try {
                using (SqlConnection conn = new SqlConnection(RecuperarCadenaDeConexion("coneccionSQL"))) {
                    conn.Open();
                    using (SqlCommand cmd = new SqlCommand(CONS_USP_CHU_EXPEDIENTE_SALUD_OBTENER, conn)) {
                        cmd.Parameters.AddWithValue("@Id", Expediente.IdExpediente);

                        cmd.CommandType = CommandType.StoredProcedure;

                        using (SqlDataReader reader = cmd.ExecuteReader()) {
                            while (reader.Read())
                            {
                                ExpedienteSalud obj = new ExpedienteSalud();

                                obj.IdExpediente = int.Parse(reader["EXP_Id"].ToString());
                                obj.EstadoActual = reader["ESA_EstadoActual"].ToString();
                                obj.Enfermedad   = bool.Parse(reader["ESA_Enfermedad"].ToString());
                                obj.Tipo         = reader["ESA_Tipo"].ToString();
                                obj.Deporte      = reader["ESA_Deporte"].ToString();
                                obj.Club         = reader["ESA_Club"].ToString();
                                obj.Pasatiempo   = reader["ESA_Pasatiempo"].ToString();
                                obj.Meta         = reader["ESA_Meta"].ToString();

                                oList.Add(obj);
                            }
                        }
                    }
                }
                return(oList);
            } catch (Exception ex) {
                throw ex;
            }
        }
コード例 #2
0
 public List <ExpedienteSalud> CHU_Expediente_Salud_Consultar(ExpedienteSalud Expediente)
 {
     return(new ExpedientesBP().CHU_Expediente_Salud_Consultar(Expediente));
 }