private void btnEliminarDocente_Click(object sender, EventArgs e) { ClsDMaestro user = new ClsDMaestro(); user.deleteDocente(Convert.ToInt32(txtIdDocente.Text)); Carga(); clear(); }
private void btnRegistarDocente_Click(object sender, EventArgs e) { try { ClsDDireccion direccion = new ClsDDireccion(); Direccion direccionRegistrar = new Direccion(); ClsDMaestro clsDUserList = new ClsDMaestro(); Maestro maestroRegistrar = new Maestro(); direccionRegistrar.residencia = txtRecidencia.Text; direccionRegistrar.municipio = txtMunicipio.Text; direccionRegistrar.departamento = txtDepartamento.Text; maestroRegistrar.nombre = txtNombreDocente.Text; maestroRegistrar.apellido = txtApellidoDocente.Text; maestroRegistrar.identificacion = txtDui.Text; maestroRegistrar.genero = cbxGenero.Text; maestroRegistrar.fechaNacimiento = dtpFecha.Value; maestroRegistrar.direccionFk = Convert.ToInt32(txtFkDireccion.Text); maestroRegistrar.contacto = txtTelefono.Text; maestroRegistrar.correo = txtEmail.Text; maestroRegistrar.activo = rbSi.Checked == true ? 1 : 2; maestroRegistrar.fechaRegistro = DateTime.Now.Date; direccion.SaveDireccion(direccionRegistrar); clsDUserList.SaveDatosUser(maestroRegistrar); } catch (Exception ex) { MessageBox.Show("Error"); } Carga(); clear(); }
private void btnModificarDocente_Click(object sender, EventArgs e) { ClsDDireccion direccion = new ClsDDireccion(); Direccion direccionRegistrar = new Direccion(); direccionRegistrar.direccionId = (Convert.ToInt32(txtIdDireccion.Text)); direccionRegistrar.residencia = txtRecidencia.Text; direccionRegistrar.municipio = txtMunicipio.Text; direccionRegistrar.departamento = txtDepartamento.Text; ClsDMaestro clsDUserList = new ClsDMaestro(); Maestro maestroUpdate = new Maestro(); maestroUpdate.maestroId = (Convert.ToInt32(txtIdDocente.Text)); maestroUpdate.nombre = txtNombreDocente.Text; maestroUpdate.apellido = txtApellidoDocente.Text; maestroUpdate.identificacion = txtDui.Text; maestroUpdate.genero = cbxGenero.Text; maestroUpdate.fechaNacimiento = dtpFecha.Value; maestroUpdate.direccionFk = Convert.ToInt32(txtFkDireccion.Text); maestroUpdate.correo = txtEmail.Text; maestroUpdate.contacto = txtTelefono.Text; maestroUpdate.activo = rbSi.Checked == true ? 1 : 2; maestroUpdate.fechaRegistro = dtpFechaDeRegistro.Value; direccion.ModificarDireccion(direccionRegistrar); clsDUserList.ModificarDocente(maestroUpdate); Carga(); clear(); }