Exemple #1
0
 private void buttonDel_Click(object sender, EventArgs e)
 {
     if (comboBox1.Text != null && comboBox1.Text != "")
     {
         using (ModelMedDBContainer db = new ModelMedDBContainer())
         {
             Head = (Doctor)db.PersonSet.Find(Head.BirthDate, Head.NameHashID);
             if (MessageBox.Show("Изменение расписания приведёт к удалению всех грядущих приёмов пациентов для этого врача. Продолжить?", "Предупреждение", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.OK)
             {
                 long     nameID = docs[comboBox1.SelectedIndex].NameHashID;
                 DateTime date   = docs[comboBox1.SelectedIndex].BirthDate;
                 Doctor   t      = (Doctor)db.PersonSet.Find(date, nameID);
                 db.FreeTimeSet.RemoveRange(t.FreeTimes);
                 t.FreeTimes.Clear();
                 bool[] weekCheck = { checkBox1.Checked, checkBox2.Checked, checkBox3.Checked, checkBox4.Checked, checkBox5.Checked, checkBox6.Checked, checkBox7.Checked };
                 t.FreeTimes = ControlFunctions.makeJob(weekCheck, dateTimePicker1.Value, t, (int)numericUpDownPeriod.Value, (int)numericUpDownHours.Value, (int)numericUpDownDays.Value);
                 var workTime = (from workT in db.WorkTimeSet where (workT.Doctor == t && workT.Start > DateTime.Today) select workT).ToList();
                 db.WorkTimeSet.RemoveRange(workTime);
                 db.SaveChanges();
             }
         }
     }
     else
     {
         MessageBox.Show("Удалять некого");
     }
 }
Exemple #2
0
        private void authorizeButton_Click(object sender, EventArgs e)
        {
            //finallyWorkingDBDataSet1.PersonSet.AddPersonSetRow()
            string mes;
            Person pers;

            if (!ControlFunctions.LoginPasswordCheck(this.loginTextBox.Text, this.passwordTextBox.Text, out mes, out pers))
            {
                MessageBox.Show(mes);
            }
            else
            if (pers is Patient)
            {
                PatientMenu patientMenu = new PatientMenu((Patient)pers);
                patientMenu.ShowDialog();
                //Thread myThread = new Thread(patientMenu.Show);
                //myThread.IsBackground = false;
                //myThread.Start();
            }
            else
            {
                DoctorMenu doctorMenu = new DoctorMenu((Doctor)pers);
                doctorMenu.ShowDialog();
            }
        }
Exemple #3
0
        private void статистикаОбращенийToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog save     = new SaveFileDialog();
            string         fileName = "";

            save.Filter = "Таблица Excel|*.xls";
            save.ShowDialog();
            fileName = save.FileName;
            if (fileName != null && fileName != "")
            {
                ControlFunctions.AnalyseVisits(fileName);
            }
        }
Exemple #4
0
        private void buttonReg_Click(object sender, EventArgs e)
        {
            string log, pas;

            if (ControlFunctions.DoctorRegistrationCall(this, out log, out pas))
            {
                MessageBox.Show("Регистрация успешно завершена. \n Логин: " + log + "\n Пароль: " + pas);
                this.Close();
            }
            else
            {
                MessageBox.Show("Регистрация не завершена. Исправьте указанные ошибки");
            }
        }