private void LlenarGridCategoria() { DataTable dt = new DataTable(); if (rbActivo.Checked) { C.Idsucursal = 0; dt = C.Listar(true); } else if (rbInactivo.Checked) { C.Idsucursal = 0; dt = C.Listar(false); } try { dtgAlmacen.Rows.Clear(); for (int x = 0; x < dt.Rows.Count; x++) { dtgAlmacen.Rows.Add(dt.Rows[x][0]); dtgAlmacen.Rows[x].Cells[0].Value = dt.Rows[x][0].ToString(); dtgAlmacen.Rows[x].Cells[1].Value = dt.Rows[x][1].ToString(); dtgAlmacen.Rows[x].Cells[2].Value = dt.Rows[x][2].ToString(); dtgAlmacen.Rows[x].Cells[3].Value = dt.Rows[x][3].ToString(); dtgAlmacen.Rows[x].Cells[4].Value = dt.Rows[x][4].ToString(); } dtgAlmacen.ClearSelection(); } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "FactSYS", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void LlenarComboAlmacen() { try { A.Idsucursal = 0; cbAlmacen.DataSource = A.Listar(true); cbAlmacen.DisplayMember = "DESCRIPCION"; cbAlmacen.ValueMember = "ID_ALMACEN"; } catch (Exception ex) { MessageBoxEx.Show(ex.Message); } }