private void btn_regresar_Click(object sender, RoutedEventArgs e) { DelegacionesRegistradas ventanaDelegaciones = new DelegacionesRegistradas(usuarioConectado); ventanaDelegaciones.Show(); this.Close(); }
private void btn_delegaciones_Click(object sender, RoutedEventArgs e) { DelegacionesRegistradas ventanaDelegaciones = new DelegacionesRegistradas(nombre); ventanaDelegaciones.Show(); this.Close(); }
private void btn_confirmarRegistroDelegacion_Click(object sender, RoutedEventArgs e) { String nombreDelegacion = txb_nombreDelegacion.Text; String colonia = txb_coloniaDelegacion.Text; String codigoPostal = txb_codigoPostal.Text; String calleNum = txb_calle.Text; String numeroTel = txb_telefono.Text; String email = txb_correo.Text; String municipio = cmb_municipio.Text; if (isNuevo == true) { if (txb_nombreDelegacion.Text == "" || txb_coloniaDelegacion.Text == "" || txb_codigoPostal.Text == "" || txb_calle.Text == "" || txb_telefono.Text == "" || txb_correo.Text == "" || cmb_municipio.Text == "") { MessageBox.Show("Campos faltantes"); } else { if (DelegacionDAO.RegistrarDelegacion(nombreDelegacion, codigoPostal, colonia, municipio, calleNum, email, numeroTel) == 1) { MessageBox.Show("Delegación registrada correctamente"); DelegacionesRegistradas ventanaDelegaciones = new DelegacionesRegistradas(usuarioConectado); ventanaDelegaciones.Show(); this.Close(); } else { MessageBox.Show("Error de registro en la delegación, inténtelo de nuevo"); } } } else { if (txb_nombreDelegacion.Text == "" || txb_coloniaDelegacion.Text == "" || txb_codigoPostal.Text == "" || txb_calle.Text == "" || txb_telefono.Text == "" || txb_correo.Text == "" || cmb_municipio.Text == "") { MessageBox.Show("Campos faltantes"); } else { int idDelegacion = DelegacionDAO.cargarIdDelecacion(nombreDelegacion); if (DelegacionDAO.ActualizarDelegacion(nombreDelegacion, colonia, codigoPostal, email, calleNum, numeroTel, municipio, idDelegacion) == 1) { MessageBox.Show("Delegación modificada correctamente"); DelegacionesRegistradas ventanaDelegaciones = new DelegacionesRegistradas(usuarioConectado); ventanaDelegaciones.Show(); this.Close(); } else { MessageBox.Show("Error de registro en la delegación, inténtelo de nuevo"); } } } }