Exemplo n.º 1
0
 /// <summary>
 /// Обработка нажатия на кнопку "Удалить"
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (lbTests.SelectedIndex < 0)
     {
         MessageBox.Show("Не выбран тест.");
         return;
     }
     try
     {
         TestManager.DeleteTest(lbTests.Items[lbTests.SelectedIndex].ToString());
         TestManager.Reset();
         FillListOfTests();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Обработка нажатия на кнопку "Изменить"
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (lbTests.SelectedIndex < 0)
     {
         MessageBox.Show("Не выбран тест.");
         return;
     }
     Hide();
     try
     {
         FormTestCreation ftc = new FormTestCreation(TestManager.GetTestParams(lbTests.Items[lbTests.SelectedIndex].ToString()));
         ftc.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     Show();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Кнопка "ОК"
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnStart_Click(object sender, EventArgs e)
        {
            Hide();//сворачиваем форму выбора метода
            TestParams ts;

            try
            {
                ts         = TestManager.GetTestParams(testName);
                ts.Patient = this.patient;
                //выбор глаза
                if (rbLeft.Checked)
                {
                    ts.CurrentEye = Eyes.Eye.left;
                }
                else
                {
                    ts.CurrentEye = Eyes.Eye.right;
                }
                //выбор метода
                if (rbThreshold.Checked)
                {
                    ts.TestMethod = TestMethods.TestMethod.threshold;
                }
                else
                {
                    ts.TestMethod = TestMethods.TestMethod.screening;
                }
                //задание текущей даты
                ts.DateOfTest = DateTime.Now;
                ft            = new FormTest(ts);
                ft.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally { Close(); }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Перезагрузить кнопки тестов
 /// </summary>
 public void ResetTestsButtons()
 {
     TestManager.Reset();
     TestManager.CreateButtons(this, panelOfTests);
 }
Exemplo n.º 5
0
 private void FormMain_Shown(object sender, EventArgs e)
 {
     TestManager.CreateButtons(this, panelOfTests);
 }