Example #1
0
        private static List <CheckListClass> temporaryCheckListsForComboBox = new List <CheckListClass>();//костылина

        public MainForm()
        {
            MainHandler.MoveDirectory();
            MainHandler.LoadInfo();
            MainHandler.MainForm = this;
            InitializeComponent();
            InitComboBoxes();
        }
Example #2
0
 private void comboBoxSubject_SelectedIndexChanged(object sender, EventArgs e)//устнвка чеклистов в combobox
 {
     comboBoxCheck.Text = "";
     comboBoxCheck.Items.Clear();
     temporaryCheckListsForComboBox.Clear();
     MainHandler.LoadCheckList(MainHandler.subjects.SubList[comboBoxSubject.SelectedIndex].CheckListIndexes);
     foreach (var item in MainHandler.checkLists)
     {
         comboBoxCheck.Items.Add(item.Inform.Name);
         temporaryCheckListsForComboBox.Add(item);
     }
 }
Example #3
0
 void StartTest(bool isTest)
 {
     if (comboBoxSubject.SelectedIndex == -1 || comboBoxPlatoon.SelectedIndex == -1 ||
         comboBoxStudent.SelectedIndex == -1 || comboBoxCheck.SelectedIndex == -1)
     {
         MessageBox.Show("Установлены не все параметры!");
         return;
     }
     else
     {
         MainHandler.CreateSession(
             platoon: MainHandler.platoons.PlatList[comboBoxPlatoon.SelectedIndex],
             student: MainHandler.platoons.PlatList[comboBoxPlatoon.SelectedIndex].Students[comboBoxStudent.SelectedIndex],
             checkList: temporaryCheckListsForComboBox[comboBoxCheck.SelectedIndex],
             subject: MainHandler.subjects.SubList[comboBoxSubject.SelectedIndex],
             isTest: isTest);
     }
     (MainHandler.TestForm = new TestForm()).Show();
     Visible = false;
 }
Example #4
0
 public FormResult(bool isTest)
 {
     InitializeComponent();
     label6.Text = $"{MainHandler.session.countOfChecks} из {MainHandler.session.CheckList.CountTasks()}";
     if (!isTest)
     {
         label8.Visible          = false;
         labelTimeResult.Visible = false;
         label3.Visible          = false;
         label6.Visible          = false;
         label7.Visible          = false;
         groupBox2.Visible       = false;
     }
     else
     {
         labelTimeResult.Text = $"{MainHandler.timeResult / 60} мин. {MainHandler.timeResult % 60} c.";
     }
     labelCurrentCourse.Text = MainHandler.session.CheckList.Inform.Course;
     labelTestName.Text      = MainHandler.session.CheckList.Inform.Name;
     labelVzvodName.Text     = MainHandler.session.Platoon.PlatNum.ToString();//TODO to object
     labelFIOName.Text       = MainHandler.session.Student.Fio;
     SetMark(isTest);
     MainHandler.SaveResult(mark, isTest);
 }