private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { emergencypatient frm = new emergencypatient(); frm.btnguardar.Hide(); DataGridViewRow act = dataGridView1.Rows[e.RowIndex]; frm.idpaemer_txt.Text = act.Cells["ID"].Value.ToString(); frm.txtname.Text = act.Cells["Paciente"].Value.ToString(); frm.cmbsex.Text = act.Cells["Sexo"].Value.ToString(); frm.txtaddres.Text = act.Cells["Direccion"].Value.ToString(); frm.txttel.Text = act.Cells["Telefono"].Value.ToString(); frm.txtprocedure.Text = act.Cells["Procedimiento"].Value.ToString(); frm.txtprecio.Text = act.Cells["Precio"].Value.ToString(); frm.txtcober.Text = act.Cells["Cobertura"].Value.ToString(); frm.txtpreap.Text = act.Cells["Total"].Value.ToString(); frm.dtptime.Text = act.Cells["Fecha"].Value.ToString(); string pay = act.Cells["Credito"].Value.ToString(); if (pay == "PAGADO") { frm.btnguardar.Hide(); frm.updatepa_btn.Hide(); frm.deletepa_btn.Hide(); frm.billpa_btn.Hide(); } else if (pay == "") { frm.btnguardar.Hide(); frm.seebill_btn.Hide(); } else if (pay == "NO PAGADO") { frm.seebill_btn.Hide(); } frm.MdiParent = this.MdiParent; frm.Show(); }
private void pacienteDeEmergenciaToolStripMenuItem1_Click(object sender, EventArgs e) { emergencypatient f = new emergencypatient(); try { Form frm2 = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is emergencypatient); 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); } }