public bool IngresarNuevo() { p = new Personal(db); p_select_stack.Visibility = Visibility.Collapsed; save_btn.Content = "Ingresar"; accion = Modalidad.Ingresar; profesiones.Cargar(); ProfsComboBox.ItemsSource = profesiones; ProfsComboBox.SelectedIndex = 0; agendaComboBox.ItemsSource = agendas; agendaComboBox.SelectedIndex = 0; bool?op = this.ShowDialog(); return(op.Value); }
public ProfesionVentana(dbcon con, bool edit = false) { InitializeComponent(); db = con; profesiones = new ProfesionList(db); profesiones.Cargar(); preselec.ItemsSource = profesiones; editmode = edit; if (!editmode) { p_select_stack.Visibility = Visibility.Collapsed; save_btn.Content = "Ingresar"; Title = "Ingresar Nueva profesion"; p = new Profesion(); } else { p_select_stack.Visibility = Visibility.Visible; save_btn.IsEnabled = false; Title = "Editar Profesion"; } }