База данных для хранения и обработки информации, которая требуется типичной психиатрической больнице, страница 15

                                                           using (OracleCommand cmd = new OracleCommand("select * from ЛЕКАРСТВА WHERE WAS_REMOVED = 0 ORDER BY НАЗВАНИЕ", connection))

                                                           using (OracleDataReader reader = cmd.ExecuteReader())

                                                           {

                                                                               while (reader.Read())

                                                                               {

                                                                                                  DbDrug entry = new DbDrug();

                                                                                                  entry.Id = Convert.ToInt32(reader["ID"]);

                                                                                                  entry.Name = reader["НАЗВАНИЕ"] as string;

                                                                                                  entry.Description = reader["ОПИСАНИЕ"] as string;

                                                                                                  result.Add(entry.Id, entry);

                                                                               }

                                                           }

                                                           return result;

                                       }

                                       /// <summary>

                                       /// Список всех заболеваний

                                       /// </summary>

                                       /// <returns></returns>

                                       public static List<DbDisease> GetAllDiseasesList()

                                       {

                                                           List<DbDisease> result = new List<DbDisease>();

                                                           using (OracleConnection connection = GetConnection())

                                                           using (OracleCommand cmd = new OracleCommand("select * from ДИАГНОЗЫ WHERE WAS_REMOVED = 0 ORDER BY НАЗВАНИЕ", connection))

                                                           using (OracleDataReader reader = cmd.ExecuteReader())

                                                           {

                                                                               while (reader.Read())

                                                                               {

                                                                                                  DbDisease entry = new DbDisease();

                                                                                                  entry.Id = Convert.ToInt32(reader["ID"]);

                                                                                                  entry.Name = reader["НАЗВАНИЕ"] as string;

                                                                                                  entry.Description = reader["ОПИСАНИЕ"] as string;

                                                                                                  result.Add(entry);

                                                                               }

                                                           }

                                                           return result;

                                       }

                                       /// <summary>

                                       /// Словарь из всех заболеваний

                                       /// </summary>

                                       public static Dictionary<int, DbDisease> GetAllDiseasesDictionary()

                                       {

                                                           Dictionary<int, DbDisease> result = new Dictionary<int, DbDisease>();

                                                           foreach (DbDisease entry in GetAllDiseasesList())

                                                                               result.Add(entry.Id, entry);

                                                           return result;

                                       }

                                       /// <summary>

                                       /// Список всех соответствий лекарств и заболеваний

                                       /// </summary>

                                       public static List<DbProperDrugDisease> GetProperDrugDisease()

                                       {

                                                           List<DbProperDrugDisease> result = new List<DbProperDrugDisease>();

                                                           using (OracleConnection connection = GetConnection())

                                                           using (OracleCommand cmd = new OracleCommand("select * from GetProperDrugDisease", connection))

                                                           using (OracleDataReader reader = cmd.ExecuteReader())

                                                           {

                                                                               while (reader.Read())

                                                                               {

                                                                                                  DbProperDrugDisease entry = new DbProperDrugDisease();

                                                                                                  entry.DrugId = Convert.ToInt32(reader["ЛЕКАРСТВО_ID"]);