Beispiel #1
0
        private void BTModifTema_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGV_Temas.SelectedRows.Count != 1)
                {
                    throw new Exception("Se debe seleccionar una fila a modificar");
                }

                string IdAModificar   = DGV_Temas.SelectedRows[0].Cells[0].Value.ToString();
                Tema   TemaAModificar = new Tema();
                TemaAModificar = temas.BuscarUno(IdAModificar);

                AgModTema modificarTema = new AgModTema(TemaAModificar)
                {
                    StartPosition = FormStartPosition.CenterScreen
                };
                modificarTema.ShowDialog();

                ActualizarGrilla();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "Error");
            }
        }
Beispiel #2
0
        private void BuscarDescripcionTema()
        {
            int valor = 0;

            int.TryParse(txtTema.Text, out valor);

            if (txtTema.Text == "" || valor == 0)
            {
                throw new Exception("Por favor ingrese un codigo valido");
            }
            //Tema tema = new Tema();
            T = T.BuscarUno(txtTema.Text);

            if (T.Descripcion != null)
            {
                txtDesTema.Text = T.Descripcion;
            }
            else
            {
                throw new Exception("No se encontro ningun Tema con el numero de codigo ingresado");
            }
        }