private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { searchpatient f = new searchpatient(); f.formulario_devolver = true; if (f.ShowDialog() == DialogResult.OK) { clear(0); txt_p_id.Text = f.textBox1.Text; } }
public void load_dgv(DataGridView dgv, string query) { try { searchpatient frm = new searchpatient(); SqlDataAdapter adac = new SqlDataAdapter(query, cnx); DataTable tabla = new DataTable("table"); adac.Fill(tabla); dgv.DataSource = tabla; } catch (Exception ex) { MessageBox.Show("No se logro cargar el visor. Causa: " + ex.Message); } }
public void search_staff_doctor(DataGridView dgv, string condition, string value) { try { searchpatient frm = new searchpatient(); SqlDataAdapter adac = new SqlDataAdapter("Select idstaff as ID, namestaff as Nombre, sexstaff as Sexo, idpersonstaff as Cedula, addressstaff as Direccion, telstaff as Telefono, celstaff as Celular, salarystaff as Salario from staff where " + condition + " like '%" + value + "%' and rolestaff = 'Doctor'", cnx); DataTable tabla = new DataTable("Pacientes"); adac.Fill(tabla); dgv.DataSource = tabla; } catch (Exception ex) { MessageBox.Show("No se logro cargar el visor. Causa: " + ex.Message); } }
public void search_patient(DataGridView dgv, string condition, string value) { try { searchpatient frm = new searchpatient(); SqlDataAdapter adac = new SqlDataAdapter("Select idpatient as ID, name as Nombre, bday as FechaNac, sex as Sexo, idperson as Cedula, address as Direccion, tel as Telefono, cel as Celular, telwork as TelTrabajo, insurance as Seguro, affiliate as Afiliado from patient where " + condition + " like '%" + value + "%' and name is not null", cnx); DataTable tabla = new DataTable("Pacientes"); adac.Fill(tabla); dgv.DataSource = tabla; } catch (Exception ex) { MessageBox.Show("No se logro cargar el visor. Causa: " + ex.Message); } }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (txt_dm_id.Text.Length > 0) { MessageBox.Show("No se puede editar el Paciente de una Visita ya guardada.", "No puede cambiar el Paciente", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { searchpatient f = new searchpatient(); f.formulario_devolver = true; if (f.ShowDialog() == DialogResult.OK) { clear(); txt_p_id.Text = f.textBox1.Text; } } }
private void administrarToolStripMenuItem_Click(object sender, EventArgs e) { searchpatient f = new searchpatient(); try { Form frm2 = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is searchpatient); if (frm2 != null) { frm2.BringToFront(); MessageBox.Show("Esta ventana ya esta abierta.", "Error"); return; } else { f.MdiParent = this; f.Show(); } } catch (Exception ex) { MessageBox.Show("No se puede abrir el ventana solicitado. Razón: " + ex.Message, "Error al abrir la ventana.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }