Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        private void reload()
        {
            var doc = docs.AsEnumerable <Staff>();

            if (dateTimePicker1.Checked == true)
            {
                if (comboBox3.SelectedIndex >= 0)
                {
                    int docid = doc.ElementAt <Staff>(comboBox3.SelectedIndex).Id_Staff;
                    var temp  = SQLRec.GetApo(patid, SQLRec.translateRoleDB(comboBox1.Text.ToString()), docid, datetostring());
                    listupdate(temp);
                }
                else
                {
                    var temp = SQLRec.GetApo(patid, SQLRec.translateRoleDB(comboBox1.Text.ToString()), datetostring());
                    listupdate(temp);
                }
            }

            else
            {
                if (comboBox3.SelectedIndex >= 0)
                {
                    int docid = doc.ElementAt <Staff>(comboBox3.SelectedIndex).Id_Staff;
                    var temp  = SQLRec.GetApo(patid, SQLRec.translateRoleDB(comboBox1.Text.ToString()), docid);
                    listupdate(temp);
                }
                else
                {
                    var temp = SQLRec.GetApo(patid, SQLRec.translateRoleDB(comboBox1.Text.ToString()));
                    listupdate(temp);
                }
            }
        }