private void btnRegistarAlumnos_Click(object sender, EventArgs e) { try { ClsDDireccion direccion = new ClsDDireccion(); Direccion direccionRegistrar = new Direccion(); ClsDEncargado encargado = new ClsDEncargado(); Encargado registarencargado = new Encargado(); ClsDAlumnos clsDAlumnos = new ClsDAlumnos(); Alumno alumnoRegistrar = new Alumno(); direccionRegistrar.residencia = txtRecidencia.Text; direccionRegistrar.municipio = txtMunicipio.Text; direccionRegistrar.departamento = txtDepartamento.Text; registarencargado.nombreEncargado = txtNombreEncargado.Text; registarencargado.apellidoEncargado = txtApellidoEncargado.Text; registarencargado.identificacionEncargado = txtDuiEncargado.Text; registarencargado.contactoEncargado = txtContactoEncargado.Text; registarencargado.correoEncargado = txtCorreoEncargado.Text; alumnoRegistrar.nombre = txtNombreAlumno.Text; alumnoRegistrar.apellidoPaterno = txtApellidoPaterno.Text; alumnoRegistrar.apellidoMaterno = txtApellidoMaterno.Text; alumnoRegistrar.genero = cbxGenero.Text; alumnoRegistrar.fechaNacimiento = dtpFecha.Value; alumnoRegistrar.direccionFk = Convert.ToInt32(txtFkDireccion.Text); alumnoRegistrar.contacto = txtContacto.Text; alumnoRegistrar.correo = txtCorreo.Text; alumnoRegistrar.activo = rbSi.Checked == true ? 1 : 2; alumnoRegistrar.fechaRegistro = DateTime.Now.Date; alumnoRegistrar.encargadoFK = Convert.ToInt32(txtFkEncargado.Text); direccion.SaveDireccion(direccionRegistrar); encargado.SaveEncargado(registarencargado); clsDAlumnos.SaveAlumno(alumnoRegistrar); } catch (Exception ex) { MessageBox.Show("Error" + ex); } Carga(); clear(); ultimoDireccion(); ultimoEncargado(); }
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(); }