private void Cargar_cmbCategoria() { var BE = new tb_pt_categoria(); var BL = new tb_pt_categoriaBL(); var dt = new DataTable(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { cmb_categoriaid.DataSource = dt; cmb_categoriaid.ValueMember = "categoriaid"; cmb_categoriaid.DisplayMember = "categorianame"; } }
private void data_Tablacategoria() { try { if (Tablacategoria.Rows.Count > 0) Tablacategoria.Rows.Clear(); tb_pt_categoriaBL BL = new tb_pt_categoriaBL(); tb_pt_categoria BE = new tb_pt_categoria(); BE.categorianame = txt_criterio.Text.Trim().ToUpper(); Tablacategoria = BL.GetAll(EmpresaID, BE).Tables[0]; if (Tablacategoria.Rows.Count > 0) { btn_imprimir.Enabled = true; gridcategoria.DataSource = Tablacategoria; gridcategoria.Rows[0].Selected = false; gridcategoria.Focus(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }