private void button_CambiarContrasenia_Click(object sender, EventArgs e) { try { if (password == textBox_passAnterior.Text) { if (textBox_PassNuevo.Text == textBox_PassRepetir.Text) { Docente_Manejador _Docente = new Docente_Manejador(); //_Docente.CambiarPass(IDDocente, textBox_PassNuevo.Text); _Docente.CambiarPass(this.IDDocente, textBox_PassNuevo.Text); MessageBox.Show("Contraseña cambiada"); } else { MessageBox.Show("La contraseña verifique la contraseña nueva"); } } else { MessageBox.Show("La contraseña no coincide con con contraseña anterior, intruduzca su antigua contraseña"); } } catch (Exception) { MessageBox.Show("Verifique los datos"); } }
private void button_Agrega_Docente_Click(object sender, EventArgs e) { String Nombre = "", ApellidoP = "", ApellidoM = "", Email = "", Telefono = ""; Int32 Edad = 0; Char Sexo = '0'; if ((textBox_Nombre.Text != null) || (textBox_ApellidoP.Text != null) || (textBox_ApellidoM.Text != null) || (textBox_Telefono.Text != null) || (comboBox_Sexo.SelectedItem != null) || numericUpDown_Edad.Value != null) { Nombre = textBox_Nombre.Text; ApellidoP = textBox_ApellidoP.Text; ApellidoM = textBox_ApellidoM.Text; Edad = Convert.ToInt32(numericUpDown_Edad.Value); if (comboBox_Sexo.Text == "Hombre") { Sexo = 'H'; } else if (comboBox_Sexo.Text == "Mujer") { Sexo = 'M'; } Email = textBox_Email.Text; Telefono = textBox_Telefono.Text; Docente Nuevo_Docente = new Docente(Nombre, ApellidoP, ApellidoM, Edad, Sexo, Email, Telefono); Docente_Manejador Manejador_Doc = new Docente_Manejador(); Manejador_Doc.Agregar_Docente(Nuevo_Docente); textBox_Nombre.Clear(); textBox_ApellidoP.Clear(); textBox_ApellidoM.Clear(); numericUpDown_Edad.Value = 0; comboBox_Sexo.Text = ""; textBox_Email.Clear(); textBox_Telefono.Clear(); } else { MessageBox.Show("Llene todos los datos porfavor"); } }