private void btnModificar_Click(object sender, EventArgs e) { try { ClsDDireccion direccion = new ClsDDireccion(); Direccion direccionModificar = new Direccion(); ClsDEncargado encargado = new ClsDEncargado(); Encargado encargadoModificar = new Encargado(); ClsDAlumnos alumnos = new ClsDAlumnos(); Alumno alumnoModificar = new Alumno(); direccionModificar.direccionId = (Convert.ToInt32(txtiDDireccion.Text)); direccionModificar.residencia = txtRecidencia.Text; direccionModificar.municipio = txtMunicipio.Text; direccionModificar.departamento = txtDepartamento.Text; encargadoModificar.encargadoId = Convert.ToInt32(txtFkEncargado.Text); encargadoModificar.nombreEncargado = txtNombreEncargado.Text; encargadoModificar.apellidoEncargado = txtApellidoEncargado.Text; encargadoModificar.identificacionEncargado = txtDuiEncargado.Text; encargadoModificar.contactoEncargado = txtContactoEncargado.Text; encargadoModificar.correoEncargado = txtCorreoEncargado.Text; alumnoModificar.alumnoId = Convert.ToInt32(txtAlumnoId.Text); alumnoModificar.nombre = txtNombreAlumno.Text; alumnoModificar.apellidoPaterno = txtApellidoPaterno.Text; alumnoModificar.apellidoMaterno = txtApellidoMaterno.Text; alumnoModificar.genero = cbxGenero.Text; alumnoModificar.fechaNacimiento = dtpFecha.Value; alumnoModificar.direccionFk = Convert.ToInt32(txtFkDireccion.Text); alumnoModificar.contacto = txtContacto.Text; alumnoModificar.correo = txtCorreo.Text; alumnoModificar.activo = rbSi.Checked == true ? 1 : 2; alumnoModificar.fechaRegistro = dtpFechaRegistro.Value; alumnoModificar.encargadoFK = Convert.ToInt32(txtFkEncargado.Text); direccion.ModificarDireccion(direccionModificar); encargado.modificarEncargado(encargadoModificar); alumnos.ModificarAlunmos(alumnoModificar); } catch (Exception ex) { MessageBox.Show("error " + ex); } Carga(); clear(); ultimoDireccion(); ultimoEncargado(); }
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(); }
void ultimoDireccion() { var consultarultimoDireccion = new ClsDDireccion(); int lista = 0; foreach (var list in consultarultimoDireccion.cargarDireccion()) { lista = list.direccionId; } lista++; txtFkDireccion.Text = lista.ToString(); }
private void btnEliminar_Click(object sender, EventArgs e) { try { ClsDAlumnos alumnos = new ClsDAlumnos(); ClsDDireccion direccion = new ClsDDireccion(); ClsDEncargado encargado = new ClsDEncargado(); alumnos.deleteAlumno(Convert.ToInt32(txtIdAlumno.Text)); direccion.deleteDireccion(Convert.ToInt32(txtiDDireccion.Text)); encargado.eliminarEncargado(Convert.ToInt32(txtFkEncargado.Text)); } 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(); }
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(); }