public void CargarDatos() { CEditoriales ed = new CEditoriales(); CAutores au = new CAutores(); CCategorias ca = new CCategorias(); CLibros li = new CLibros(); editorialesBindingSource.DataSource = ed.Listado(); autoresBindingSource.DataSource = au.Listado(); categoriasBindingSource.DataSource = ca.Listado(); librosBindingSource.DataSource = li.Listado(); }
void cargarLista() { CEditoriales c = new CEditoriales(); editorialesBindingSource.DataSource = c.Listado(); foreach (DataGridViewRow i in dtgEditoriales.Rows) { edi.Add(new entidades.Editoriales { Id_Editorial = int.Parse(i.Cells[0].Value.ToString()), Editorial = i.Cells[1].Value.ToString(), Fundada = Convert.ToDateTime(i.Cells[2].Value.ToString()), Direccion = i.Cells[3].Value.ToString() }); } }
private void btnGuardar_Click(object sender, EventArgs e) { if (editorialTextBox.Text != "" && direccionTextBox.Text != "") { Editoriales edi = new Editoriales(); CEditoriales edit = new CEditoriales(); editorialesBindingSource.EndEdit(); edi = (Editoriales)editorialesBindingSource.Current; edit.guardar(edi); editorialesBindingSource.Clear(); frmPrincipal.editoriales.CargarDatos(); this.Close(); } else { MessageBox.Show("Todos los campos son obligatorios"); } }
public void CargarDatos() { CEditoriales c = new CEditoriales(); editorialesBindingSource.DataSource = c.Listado(); }