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

                                                           }

                                                           return result;

                                       }

                                       /// <summary>

                                       /// Получение списка всех наказаний

                                       /// </summary>

                                       public static List<DbPunishment> GetAllPunishments()

                                       {

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

                                                           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())

                                                                               {

                                                                                                  result.Add(new DbPunishment(Convert.ToInt32(reader["ID"]), reader["НАЗВАНИЕ"] as string));

                                                                               }

                                                           }

                                                           return result;

                                       }

                                       /// <summary>

                                       /// Получение списка всех людей

                                       /// </summary>

                                       public static List<DbPerson> GetAllPersons()

                                       {

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

                                                           using (OracleConnection connection = GetConnection())

                                                           using (OracleCommand cmd = new OracleCommand("select * from ЧЕЛОВЕК ORDER BY ФАМИЛИЯ", connection))

                                                           using (OracleDataReader reader = cmd.ExecuteReader())

                                                           {

                                                                               while (reader.Read())

                                                                               {

                                                                                                  result.Add(ReadPersonInfo(new DbPerson(), reader));

                                                                               }

                                                           }

                                                           return result;

                                       }

                                       /// <summary>

                                       /// Добавление нового сотрудника с новой записью в таблицу ЧЕЛОВЕК

                                       /// </summary>

                                       /// <param name="information">инфа о новом сотруднике</param>

                                       public static void AddNewEmployee(DbEmployee information, bool setDates)

                                       {

                                                           using (OracleConnection connection = GetConnection())

                                                           {

                                                                               OracleTransaction transaction = connection.BeginTransaction();

                                                                               try

                                                                               {

                                                                                                  information.HumanID = executePersonAddition(information, connection, transaction);

                                                                                                  executeEmployeeAddition(information, connection, transaction, setDates);

                                                                                                  transaction.Commit();

                                                                               }

                                                                               catch (Exception excpt)

                                                                               {

                                                                                                  transaction.Rollback();

                                                                                                  throw excpt;

                                                                               }

                                                           }

                                       }

                                       public static void AddNewEmployee(DbEmployee information) { AddNewEmployee(information, false); }

                                       /// <summary>

                                       /// Добавление нового сотрудника с имеющейся записью в таблице ЧЕЛОВЕК

                                       /// </summary>

                                       /// <param name="information">инфа о новом сотруднике</param>

                                       public static void AddNewEmployeeFromExistingPerson(DbEmployee information)