Exemple #1
0
        public override void GetById(int?id)
        {
            SqlCommand command = Connection.GetCommand();

            command.CommandText = "SELECT * FROM Prescription WHERE PrescriptionID = @id";
            command.Parameters.AddWithValue("@id", id);
            SqlDataReader reader       = command.ExecuteReader();
            int           medicamentId = 0;
            int           diagnosisId  = 0;

            if (reader.HasRows)
            {
                reader.Read();
                Id           = id;
                medicamentId = reader.GetInt32(1);
                diagnosisId  = reader.GetInt32(2);
            }
            reader.Close();

            Medicament = new Medicament();
            Medicament.GetById(medicamentId, Connection);
            Diagnosis = new Diagnosis();
            Diagnosis.GetById(diagnosisId, Connection);
        }
Exemple #2
0
 public override string ToString()
 {
     return($"Симптом: {{ {Diagnosis.ToString()}, {Archetype.ToString()}, Значение архетипа: {ArchetypeValue} }}");
 }
Exemple #3
0
 public Prescription(Medicament medicament, Diagnosis diagnosis, SqlConnection connection) : this()
 {
     Connection = connection;
     Medicament = medicament;
     Diagnosis  = diagnosis;
 }