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

                                       private static int executePatientAddition(DbPatient information, OracleConnection connection, OracleTransaction transaction)

                                       {

                                                           using (OracleCommand cmd = new OracleCommand("AddDiseaseHistoryEntry", connection, transaction))

                                                           {

                                                                               cmd.CommandType = CommandType.StoredProcedure;

                                                                               cmd.Parameters.AddWithValue("pДИАГНОЗ_ID", information.DiseaseID);

                                                                               cmd.Parameters.AddWithValue("pБОЛЬНОЙ_ID", information.ID);

                                                                               cmd.Parameters.Add("pID", OracleType.Int32).Direction = ParameterDirection.Output;

                                                                               cmd.ExecuteNonQuery();

                                                                               return (int)cmd.Parameters["pID"].Value;

                                                           }

                                       }

                                       private static void executeEmployeeAddition(DbEmployee information, OracleConnection connection, OracleTransaction transaction, bool setDates)

                                       {

                                                           using (OracleCommand cmd = new OracleCommand("CreateNewEmployee", connection, transaction))

                                                           {

                                                                               cmd.CommandType = CommandType.StoredProcedure;

                                                                               cmd.Parameters.AddWithValue("pЧЕЛОВЕК_ID", information.HumanID);

                                                                               cmd.Parameters.AddWithValue("pДОЛЖНОСТЬ_ID", information.PostID);

                                                                               cmd.Parameters.AddWithValue("pДАТА_РОЖДЕНИЯ", ToDate(information.BirthDate));

                                                                               if (setDates)

                                                                               {

                                                                                                  cmd.Parameters.AddWithValue("pКОГДА_УСТРОИЛСЯ", information.PlacementDate).Direction = ParameterDirection.InputOutput;

                                                                                                  cmd.Parameters.AddWithValue("pКОГДА_УВОЛИЛСЯ", information.FiredDate ?? (object)DBNull.Value);

                                                                               }

                                                                               else

                                                                               {

                                                                                                  OracleParameter placement = cmd.Parameters.Add("pКОГДА_УСТРОИЛСЯ", OracleType.DateTime);

                                                                                                  placement.Direction = ParameterDirection.InputOutput;

                                                                                                  placement.Value = DBNull.Value;

                                                                                                  cmd.Parameters.AddWithValue("pКОГДА_УВОЛИЛСЯ", DBNull.Value);

                                                                               }

                                                                               cmd.Parameters.AddWithValue("pКОНТАКТНЫЙ_ТЕЛЕФОН", information.Phone);

                                                                               cmd.Parameters.AddWithValue("pLOGIN", information.Login);

                                                                               cmd.Parameters.AddWithValue("pPASSWORD", getHashString(information.Password));

                                                                               cmd.Parameters.Add(getPhotoParameter("pФОТОГРАФИЯ", information.Photography));

                                                                               cmd.Parameters.Add("pID", OracleType.Int32).Direction = ParameterDirection.Output;

                                                                               cmd.ExecuteNonQuery();

                                                                               if (!setDates)

                                                                               {

                                                                                                  information.PlacementDate = (DateTime)cmd.Parameters["pКОГДА_УСТРОИЛСЯ"].Value;

                                                                               }

                                                                               information.ID = (int)cmd.Parameters["pID"].Value;

                                                           }

                                       }

                                       #endregion

                                       internal static void RemovePost(int id)

                                       {

                                                           using (OracleConnection connection = GetConnection())

                                                           using (OracleCommand cmd = new OracleCommand("RemovePost", connection))