public FormPatient(int id) { InitializeComponent(); patid = id; FillProfile(); List<department> departmentlist = new List<department>(); using (hc_dbEntities1 h = new hc_dbEntities1()) { departmentlist = h.department.ToList(); } for (int i = 0; i < departmentlist.Count; i++) { comboBox1.Items.Add(departmentlist[i].name); } label5.Text = "Новости нашей психушки:\nВсе вроде хорошо..."; dataGridView1.RowCount = 7; dataGridView1[0, 0].Value = "Понедельник"; dataGridView1[0, 1].Value = "Вторник"; dataGridView1[0, 2].Value = "Среда"; dataGridView1[0, 3].Value = "Четверг"; dataGridView1[0, 4].Value = "Пятница"; dataGridView1[0, 5].Value = "Суббота"; dataGridView1[0, 6].Value = "Воскресенье"; FillHistory(); }
private void SetGrid(List<healing> list) { SetDL(); for (int i = 0; i < list.Count; i++) { DateTime date = list[i].healing_time; if (DateTime.Compare(GetMinWeekDate(), DateTime.Now) <= 0 && DateTime.Compare(GetMaxWeekDate(), DateTime.Now) >= 0) for (int j = 1; j < 18; j++) { if (dataGridView1.Columns[j].HeaderText == (date.Hour + ":" + date.Minute/10 + "0")) dataGridView1[j, GetDayOfWeek(date.DayOfWeek) - 1].Style.BackColor = System.Drawing.Color.LightPink; } } }
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { doctorlist = new List<doctor>(); specid = specidlist[comboBox2.SelectedIndex]; using (hc_dbEntities1 h = new hc_dbEntities1()) { doctorlist = h.doctor.Where(doc=>doc.id_spec == specid).ToList(); } comboBox3.Items.Clear(); for (int i = 0; i < doctorlist.Count; i++) { comboBox3.Items.Add(doctorlist[i].FIO); } comboBox3.Enabled = true; }
private void comboBox3_SelectedIndexChanged(object sender, EventArgs e) { List<healing> healinglist = new List<healing>(); docid = doctorlist[comboBox3.SelectedIndex].id_doctor; using (hc_dbEntities1 h = new hc_dbEntities1()) { healinglist = h.healing.Where(hea => hea.id_doctor == docid).ToList(); } SetGrid(healinglist); dataGridView1.Enabled = true; }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { List<spec> speclist = new List<spec>(); depid = comboBox1.SelectedIndex; using (hc_dbEntities1 h = new hc_dbEntities1()) { speclist = h.spec.Where(spe=>spe.id_department == depid).ToList(); } comboBox2.Items.Clear(); specid = 0; comboBox3.Items.Clear(); docid = 0; for (int i = 0; i < speclist.Count; i++) { comboBox2.Items.Add(speclist[i].name); specidlist.Add(speclist[i].id_spec); } comboBox2.Enabled = true; }