private void LlenarComboMarca() { try { cbMarca.DataSource = M.Listar(true); cbMarca.DisplayMember = "DESCRIPCION"; cbMarca.ValueMember = "ID_MARCA"; } catch (Exception ex) { MessageBoxEx.Show(ex.Message); } }
private void LlenarGridMarca() { DataTable dt = new DataTable(); dt = M.Listar(true); try { dtgMarca.Rows.Clear(); for (int x = 0; x < dt.Rows.Count; x++) { dtgMarca.Rows.Add(dt.Rows[x][0]); dtgMarca.Rows[x].Cells[0].Value = dt.Rows[x][0].ToString(); dtgMarca.Rows[x].Cells[1].Value = dt.Rows[x][1].ToString(); dtgMarca.Rows[x].Cells[2].Value = dt.Rows[x][2].ToString(); } dtgMarca.ClearSelection(); } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "FactSYS", MessageBoxButtons.OK, MessageBoxIcon.Information); } }