private void txtnom_TextChanged_1(object sender, EventArgs e) { if (radioButton1.Checked && txtnom.TextLength >= 0) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedNom(txtnom.Text.ToUpper()); dataGridView1.DataSource = busc.Mostrar_Resultados(); } else if (radioButton2.Checked && txtCod.TextLength == 0) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedNom(""); dataGridView1.DataSource = busc.Mostrar_Resultados(); } else if (radioButton2.Checked && txtCod.TextLength >= 1) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedCod(txtCod.Text); dataGridView1.DataSource = busc.Mostrar_Resultados(); } else { dataGridView1.DataSource = null; } lblCan.Text = "*"; lblNom.Text = "*"; lblDes.Text = "*"; lblCod.Text = "*"; txtUnidad.Text = "*"; label10.Text = "*"; button1.Enabled = false; btnIng.Enabled = false; btnSac.Enabled = false; }
private void button2_Click(object sender, EventArgs e) { Base_de_datos.CodMed = lblCod.Text; Base_de_datos.nommedi = lblNom.Text; Base_de_datos.cant = lblCan.Text; Base_de_datos.desc = txtUnidad.Text; Base_de_datos.unidad = label10.Text; btnIng.Enabled = false; btnSac.Enabled = false; button1.Enabled = false; lblCan.Text = "*"; lblNom.Text = "*"; lblDes.Text = "*"; lblCod.Text = "*"; txtUnidad.Text = "*"; label10.Text = "*"; txtCod.Text = ""; txtnom.Text = ""; dataGridView1.DataSource = null; venc a = new venc(); a.ShowDialog(); if (a.DialogResult == DialogResult.OK) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedNom(""); dataGridView1.DataSource = busc.Mostrar_Resultados(); } }
public Busqueda_medicamentos() { Base_de_datos busc = new Base_de_datos(); InitializeComponent(); busc.BuscarMedNom(""); dataGridView1.DataSource = busc.Mostrar_Resultados(); }
private void txtnom_TextChanged_1(object sender, EventArgs e) { txtnom.Focus(); if (radioButton1.Checked && txtnom.TextLength >= 0) { Base_de_datos busc = new Base_de_datos(); busc.BuscarMedNom(txtnom.Text.ToUpper()); dataGridView1.DataSource = busc.Mostrar_Resultados(); } else { dataGridView1.DataSource = null; } }
public Receta() { InitializeComponent(); txtcita.Text = Base_de_datos.cita; Base_de_datos.decis = 1; Base_de_datos busc = new Base_de_datos(); busc.BuscarMedNom(""); dataGridView1.DataSource = busc.Mostrar_Resultados(); busc.BuscarRiesgo(); dataGridView3.DataSource = busc.Mostrar_Resultados(); foreach (DataGridViewRow row in dataGridView3.Rows) { txtriesgo.Items.Add(row.Cells[1].Value.ToString()); } }