private void refresh() { listView1.Items.Clear(); var res = SQLRec.GetPatientsList(textBox1.Text, textBox2.Text, textBox3.Text); foreach (var order in res) { ListViewItem lvi = new ListViewItem(order.Name.ToString()); lvi.SubItems.Add(order.Surname); lvi.SubItems.Add(order.PESEL); listView1.Items.Add(lvi); } }
private void button1_Click(object sender, EventArgs e) { listView1.Items.Clear(); var res = SQLRec.GetPatientsList(textBox1.Text, textBox2.Text, textBox3.Text); foreach (var order in res) { ListViewItem lvi = new ListViewItem(order.Name.ToString()); lvi.SubItems.Add(order.Surname); lvi.SubItems.Add(order.PESEL); listView1.Items.Add(lvi); } }
public Reg() { InitializeComponent(); listView1.Items.Clear(); var res = SQLRec.GetPatientsList("", "", ""); foreach (var order in res) { ListViewItem lvi = new ListViewItem(order.Name.ToString()); lvi.SubItems.Add(order.Surname); lvi.SubItems.Add(order.PESEL); listView1.Items.Add(lvi); } listView1.FullRowSelect = true; listView1.GridLines = true; }
private void button4_Click(object sender, EventArgs e)//show { if (listView1.SelectedItems.Count > 0) { ListViewItem item = listView1.SelectedItems[0]; var res = SQLRec.GetPatientsList(item.SubItems[0].Text.TrimEnd(), item.SubItems[1].Text.TrimEnd(), item.SubItems[2].Text.TrimEnd()); foreach (var x in res) { WindowPanel.Controls.Add(new VisitViewercs(x.Id_Patient, connector)); WindowPanel.Visible = true; WindowPanel.Dock = DockStyle.Fill; WindowPanel.BringToFront(); } } }
private void button3_Click(object sender, EventArgs e)//visit registarion { if (listView1.SelectedItems.Count > 0) { ListViewItem item = listView1.SelectedItems[0]; var res = SQLRec.GetPatientsList(item.SubItems[0].Text.TrimEnd(), item.SubItems[1].Text.TrimEnd(), item.SubItems[2].Text.TrimEnd()); foreach (var x in res) { WindowPanel.Controls.Add(new VisitRegistration(x.Id_Patient, connector, whoami)); WindowPanel.Visible = true; WindowPanel.Dock = DockStyle.Fill; WindowPanel.BringToFront(); } } else { MessageBox.Show("Nie wybrano pacjenta"); } }