private void btnAgregarRamo_Click(object sender, RoutedEventArgs e) { try { Biblioteca.Programa programa = new Biblioteca.Programa() { Id_programa = int.Parse(cbprogramas.SelectedItem.ToString().Split()[0]) }; lblMsj.Content = programa.agregarRamo(int.Parse(cbRamos.SelectedItem.ToString().Split()[0])); programa.read(); listbox.ItemsSource = programa.listaRamos; } catch (Exception ex) { lblMsj.Content = "Error: " + ex; } }
private void cbprogramas_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { Biblioteca.Programa programa = new Biblioteca.Programa() { Id_programa = int.Parse(cbprogramas.SelectedItem.ToString().Split()[0]) }; programa.read(); txtNombre.Text = programa.Nombre; txtCupos.Text = programa.Cupos.ToString(); txtAlumMax.Text = programa.Alum_max.ToString(); txtAlumMin.Text = programa.Alum_min.ToString(); dp_fecha_inicio.Text = programa.Fecha_inicio.ToString(); dp_fecha_termino.Text = programa.Fecha_termino.ToString(); } catch (Exception ex) { lblMsj.Content = "Error: " + ex; } }
private void cbprogramas_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { Biblioteca.Programa programa = new Biblioteca.Programa() { Id_programa = int.Parse(cbprogramas.SelectedItem.ToString().Split()[0]) }; programa.read(); listbox.ItemsSource = programa.listaRamos; listbox.IsEnabled = true; llenarRamos(); cbRamos.IsEnabled = true; btnAgregarRamo.IsEnabled = true; } catch (Exception ex) { lblMsj.Content = "Error: " + ex; } }