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

                                                                               cmd.Parameters.AddWithValue(":ДИАГНОЗ_ID", diseaseId);

                                                                               cmd.ExecuteNonQuery();

                                                           }

                                       }

                                       /// <summary>

                                       /// Удаление соответствия между лекарством и болезнью

                                       /// </summary>

                                       public static void RemoveProperDrugDisease(int drugId, int diseaseId)

                                       {

                                                           using (OracleConnection connection = GetConnection())

                                                           using (OracleCommand cmd = new OracleCommand("DELETE FROM ЛЕКАРСТВА_ДИАГНОЗЫ WHERE ЛЕКАРСТВО_ID=:ЛЕКАРСТВО_ID AND ДИАГНОЗ_ID=:ДИАГНОЗ_ID", connection))

                                                           {

                                                                               cmd.Parameters.AddWithValue(":ЛЕКАРСТВО_ID", drugId);

                                                                               cmd.Parameters.AddWithValue(":ДИАГНОЗ_ID", diseaseId);

                                                                               cmd.ExecuteNonQuery();

                                                           }

                                       }

                                       /// <summary>

                                       /// Удаление лекарства по ID

                                       /// </summary>

                                       public static void RemoveDrug(int drugId)

                                       {

                                                           using (OracleConnection connection = GetConnection())

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

                                                           {

                                                                               cmd.CommandType = CommandType.StoredProcedure;

                                                                               cmd.Parameters.AddWithValue("pID", drugId);

                                                                               cmd.ExecuteNonQuery();

                                                           }

                                       }

                                       /// <summary>

                                       /// Удаление заболевания по ID

                                       /// </summary>

                                       public static void RemoveDisease(int diseaseId)

                                       {

                                                           using (OracleConnection connection = GetConnection())

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

                                                           {

                                                                               cmd.CommandType = CommandType.StoredProcedure;

                                                                               cmd.Parameters.AddWithValue("pID", diseaseId);

                                                                               cmd.ExecuteNonQuery();

                                                           }

                                       }

                                       /// <summary>

                                       /// Удаление наказания по ID

                                       /// </summary>

                                       public static void RemovePunishment(int punishId)

                                       {

                                                           using (OracleConnection connection = GetConnection())

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

                                                           {

                                                                               cmd.CommandType = CommandType.StoredProcedure;

                                                                               cmd.Parameters.AddWithValue("pID", punishId);

                                                                               cmd.ExecuteNonQuery();

                                                           }

                                       }

                                       /// <summary>

                                       /// Проверка на простой пароль

                                       /// </summary>

                                       public static string CheckForSimplePassword(string password)

                                       {

                                                           if (password.Length < 6) return "Длина пароля должна быть не менее 6 символов";

                                                           string test = password;

                                                           for (int i = 0; i < 10; i++)

                                                                               test = test.Replace(i.ToString(), "");

                                                           if (test == "") return "Пароль должен состоять не только из цифр.";

                                                           test = password.ToLower();

                                                           if (test == "password" || test == "пароль") return "Сразу отрывайте руки за такие пароли!";