예제 #1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;

                if (!(listadoAlumnosBindingSource.Current is AlumnoDto seleccionado))
                {
                    return;
                }

                _alumno = _alumnoClass.GetAlumno(seleccionado.Id);
                alumnoBindingSource.DataSource = _alumno;
                alumnoBindingSource.ResetBindings(false);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Text, MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
예제 #2
0
        private void BtnEditar_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                Cursor = Cursors.Wait;

                if (!(ListViewAlumnos.SelectedItem is AlumnoDto seleccionado))
                {
                    return;
                }

                _alumno = _alumnoClass.GetAlumno(seleccionado.Id);
                GridControles.DataContext = _alumno;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            finally
            {
                Cursor = Cursors.Arrow;
            }
        }