public formFrases(int idAutor, int idLibro) { InitializeComponent(); btnBuscar.Enabled = false; btnEditar.Enabled = true; btnNO.Enabled = true; chk_autor.Enabled = false; chk_libro.Enabled = false; cmbAutores.Enabled = false; cmbLibros.Enabled = false; ValorInicial(); this.cmbAutores.DataSource = new AutorLogic().GetAll(Program.IdUsuario); this.cmbAutores.ValueMember = "idAutor"; this.cmbAutores.DisplayMember = "apynom"; this.cmbAutores.SelectedIndex = -1; this.cmbLibros.DataSource = new LibroLogic().GetAll(Program.IdUsuario); this.cmbLibros.ValueMember = "idLibro"; this.cmbLibros.DisplayMember = "titulo"; this.cmbLibros.SelectedIndex = -1; Autores AutorActual = new AutorLogic().GetOne(idAutor, Program.IdUsuario); Libros LibroActual = new LibroLogic().GetOne(idLibro, Program.IdUsuario); cmbAutores.SelectedValue = AutorActual.IdAutor; cmbLibros.SelectedValue = LibroActual.IdLibro; CargarGrilla(AutorActual.IdAutor, LibroActual.IdLibro); }
private void CargarGrilla() { List <Entidades.Autores> autores = new AutorLogic().GetAll(Program.IdUsuario); if (autores.Count > 0) { this.dgv_Autores.DataSource = autores; } else { MessageBox.Show("¡No se han cargado Autores!", "Mensaje del sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } dgv_Autores.CurrentCell = null; }