public VisitViewercs(int ID, TextBox text) : this() { listView1.FullRowSelect = true; listView1.GridLines = true; patid = ID; textb = text; var res = SQLLab.GetPatientData(patid); foreach (var order in res) { textBox1.Text = order.PESEL; } docs = SQLAdm.GetStaff("", "", "", "doc"); foreach (var order in docs) { comboBox3.Items.Add(order.Surname); } listView1.Items.Clear(); var temp = SQLRec.GetApo(patid); foreach (var order in temp) { ListViewItem lvi = new ListViewItem(order.Id_Appointment.ToString()); var tmp = SQLRec.GetDocData(order.Id_Doctor); string name = tmp.FirstOrDefault().Name + " " + tmp.FirstOrDefault().Surname; lvi.SubItems.Add(name); lvi.SubItems.Add(order.Date_Appointment.ToString()); lvi.SubItems.Add(SQLRec.translateRolePL(order.State.ToString())); listView1.Items.Add(lvi); } }
private void listupdate(IQueryable <Appointment> temp) { listView1.Items.Clear(); foreach (var order in temp) { ListViewItem lvi = new ListViewItem(order.Id_Appointment.ToString()); var tmp = SQLRec.GetDocData(order.Id_Doctor); string name = tmp.FirstOrDefault().Name + " " + tmp.FirstOrDefault().Surname; lvi.SubItems.Add(name); lvi.SubItems.Add(order.Date_Appointment.ToString()); lvi.SubItems.Add(SQLRec.translateRolePL(order.State.ToString())); listView1.Items.Add(lvi);; } }