private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { addsubprocedure frm = new addsubprocedure(); DataGridViewRow act = dataGridView1.Rows[e.RowIndex]; frm.idsubprocedure_txt.Text = act.Cells["ID"].Value.ToString(); frm.spnamepatient_txt.Text = act.Cells["Paciente"].Value.ToString(); frm.spnamedoctor_txt.Text = act.Cells["Doctor"].Value.ToString(); frm.sprocedure_txt.Text = act.Cells["Procedimiento"].Value.ToString(); frm.sprealpay_txt.Text = act.Cells["Precio"].Value.ToString(); frm.spiscoverage_txt.Text = act.Cells["Cobertura"].Value.ToString(); frm.sppricepay_txt.Text = act.Cells["Total"].Value.ToString(); frm.status_txt.Text = act.Cells["Credito"].Value.ToString(); string pay = act.Cells["Credito"].Value.ToString(); frm.sidpatient.Text = act.Cells["IdPaciente"].Value.ToString(); if (pay == "NO PAGADO") { } else if (pay == "") { } else if (pay == "PAGADO") { } frm.MdiParent = this.MdiParent; frm.Show(); }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { addsubprocedure frm = new addsubprocedure(); DataGridViewRow act = dataGridView1.Rows[e.RowIndex]; frm.idsubprocedure_txt.Text = act.Cells["ID"].Value.ToString(); frm.spnamepatient_txt.Text = act.Cells["Paciente"].Value.ToString(); frm.spnamedoctor_txt.Text = act.Cells["Doctor"].Value.ToString(); frm.sprocedure_txt.Text = act.Cells["Procedimiento"].Value.ToString(); frm.sprealpay_txt.Text = act.Cells["Precio"].Value.ToString(); frm.spiscoverage_txt.Text = act.Cells["Cobertura"].Value.ToString(); frm.sppricepay_txt.Text = act.Cells["Total"].Value.ToString(); frm.status_txt.Text = act.Cells["Credito"].Value.ToString(); SQLiteConnection cnx = new SQLiteConnection("Data Source=C:\\syspandemic\\db\\syspandemic.db;Version=3;"); try { cnx.Open(); string idprocedure = act.Cells["ID"].Value.ToString(); SQLiteDataAdapter adac = new SQLiteDataAdapter("Select id as ID, idprocedure as ProcedureNo, subprocedure as SubProceso, date as Fecha from subprocedure where idprocedure = '" + idprocedure + "'", cnx); DataTable tabla = new DataTable("Sub-Procedimientos"); adac.Fill(tabla); frm.dataGridView1.DataSource = tabla; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } frm.MdiParent = this.MdiParent; frm.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }