Пример #1
0
        public Planes ObtenerPlanes(int id)
        {
            Planes planes = new Planes();

            using (SqlConnection con = new SqlConnection(ConnectionString))
            {
                SqlCommand cmd = new SqlCommand("PLANES_SELECT", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Id", id);

                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                rdr.Read();
                planes.ID             = Convert.ToInt32(rdr["Id"]);
                planes.Plan           = Convert.ToString(rdr["Planes"]);
                planes.MontoCobertura = Convert.ToDecimal(rdr["Monto_Cobertura"]);
                planes.FechaRegistro  = Convert.ToDateTime(rdr["Fecha_Registro"]);
                planes.Estatuses      = ObtenerEstatus(Convert.ToInt32(rdr["Id_Estatus"]));
                con.Close();
            }
            return(planes);
        }