// Combo Parte Prenda void CargaPartePrenda() { tb_pp_parteprendaBL BL = new tb_pp_parteprendaBL(); tb_pp_parteprenda BE = new tb_pp_parteprenda(); DataTable dt = new DataTable(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { cmb_partepda.DataSource = dt; cmb_partepda.ValueMember = "partepdaid"; cmb_partepda.DisplayMember = "partepdaname"; cmb_partepda.SelectedIndex = 0; } }
private void data_TablaPartePrenda() { try { if (TablaPartePrenda.Rows.Count > 0) { TablaPartePrenda.Rows.Clear(); } var BL = new tb_pp_parteprendaBL(); var BE = new tb_pp_parteprenda(); BE.partepdaname = txtbusqueda.Text.ToString(); TablaPartePrenda = BL.GetAll(EmpresaID, BE).Tables[0]; if (TablaPartePrenda.Rows.Count > 0) { btn_imprimir.Enabled = true; dgv_parteprenda.DataSource = TablaPartePrenda; dgv_parteprenda.Rows[0].Selected = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }