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

                                                                               cmd.Parameters.Add("pДОЛЖНОСТЬ", OracleType.VarChar, 30).Direction = ParameterDirection.Output;

                                                                               cmd.Parameters.Add("pКОНТАКТНЫЙ_ТЕЛЕФОН", OracleType.VarChar, 30).Direction = ParameterDirection.Output;

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

                                                                               cmd.Parameters.Add("pКОГДА_УВОЛИЛСЯ", OracleType.DateTime).Direction = ParameterDirection.Output;

                                                                               cmd.Parameters.Add("pДАТА_РОЖДЕНИЯ", OracleType.DateTime).Direction = ParameterDirection.Output;

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

                                                                               cmd.Parameters.Add("pФОТОГРАФИЯ", OracleType.Blob).Direction = ParameterDirection.Output;

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

                                                                               cmd.ExecuteNonQuery();

                                                                               DbEmployee result = new DbEmployee();

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

                                                                               result.Name = cmd.Parameters["pИмя"].Value as string;

                                                                               result.Surname = cmd.Parameters["pФамилия"].Value as string;

                                                                               result.Patronymic = cmd.Parameters["pОтчество"].Value as string;

                                                                               result.Passport = (cmd.Parameters["pПАСПОРТ"].Value as string) ?? "";

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

                                                                               result.FiredDate = readNullableDate(cmd.Parameters["pКОГДА_УВОЛИЛСЯ"].Value);

                                                                               result.AdministerOptions = Convert.ToInt32(cmd.Parameters["pAdministerOptions"].Value);

                                                                               //result.HumanID = Convert.ToInt32(cmd.Parameters["pЧЕЛОВЕК_ID"].Value);

                                                                               result.Login = login;

                                                                               result.Password = password;

                                                                               result.Phone = (cmd.Parameters["pКОНТАКТНЫЙ_ТЕЛЕФОН"].Value as string) ?? "";

                                                                               OracleLob imageStream = cmd.Parameters["pФОТОГРАФИЯ"].Value as OracleLob;

                                                                               imageStream.BeginBatch(OracleLobOpenMode.ReadOnly);

                                                                               try { result.Photography = new Bitmap(new Bitmap(imageStream)); }

                                                                               catch { result.Photography = Properties.Resources.No_Image; }

                                                                               finally { imageStream.EndBatch(); }

                                                                               result.BirthDate = ToDate((DateTime)cmd.Parameters["pДАТА_РОЖДЕНИЯ"].Value);

                                                                               //result.PostID = Convert.ToInt32(cmd.Parameters["ДОЛЖНОСТЬ_ID"].Value);

                                                                               result.Post = cmd.Parameters["pДОЛЖНОСТЬ"].Value as string;

                                                                               return result;

                                                           }

                                       }

                                       /// <summary>

                                       /// Данные о себе, которые простой юзверь может изменить

                                       /// </summary>

                                       /// <param name="information"></param>

                                       public static void UserUpdateEmployeeInfo(DbEmployee information)

                                       {

                                                           using (OracleConnection connection = GetConnection())

                                                           {

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

                                                                               {

                                                                                                  cmd.CommandType = CommandType.StoredProcedure;

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