private void button2_Click(object sender, EventArgs e) //show { if (listView1.SelectedItems.Count > 0) { ListViewItem item = listView1.SelectedItems[0]; PatientsSearchCriteria searchCriteria = new PatientsSearchCriteria(); long pesel = long.Parse(item.SubItems[4].Text.TrimEnd()); searchCriteria.setPesel(pesel); // Refresh(SQLDoc.GetPatient(searchCriteria)); var res = SQLDoc.GetPatient(searchCriteria); foreach (var x in res) { panel1.Controls.Clear(); panel1.Controls.Add(new Show(x.patientTable.Id_Patient, item.SubItems[0].Text.TrimEnd())); panel1.Visible = true; panel1.Dock = DockStyle.Fill; panel1.BringToFront(); } } else { MessageBox.Show("Nie wybrano pacjenta"); } }
private void button3_Click(object sender, EventArgs e) //handle { if (listView1.SelectedItems.Count > 0) { ListViewItem item = listView1.SelectedItems[0]; PatientsSearchCriteria searchCriteria = new PatientsSearchCriteria(); long pesel = long.Parse(item.SubItems[4].Text.TrimEnd()); searchCriteria.setPesel(pesel); var x = SQLDoc.GetPatientsList("", "", item.SubItems[4].Text.TrimEnd().ToString()); panel1.Controls.Clear(); panel1.Controls.Add(new Handle(x.First().Id_Patient, item.SubItems[0].Text.TrimEnd())); panel1.Visible = true; panel1.Dock = DockStyle.Fill; panel1.BringToFront(); } else { MessageBox.Show("Nie wybrano pacjenta"); } }