public void StatsGeneralVisualization()
    {
        var sessionsDB = new SessionsDB();

        successCompletedTrainingsCounter.text = sessionsDB.getNumberCompletedSessions().ToString();
        runningTrainingsCounter.text          = sessionsDB.getNumberRunningSessions().ToString();
        sessionsDB.close();
        var studentsDB = new StudentsDB();

        registeredStudentsCounter.text = studentsDB.getNumberRegisteredStudents().ToString();
        studentsDB.close();
    }
示例#2
0
    public void startSessions()
    {
        int currTaskId = -1;

        foreach (LabBlock labBlock in labBlocks)
        {
            if (labBlock.toggleButton.IsOn)
            {
                currTaskId = labBlock.taskId;
            }
        }
        ;
        if (currTaskId == -1)
        {
            MenuUIManager.Instance.SendPopup(3, "Необходимо выбрать одну из задач");
            return;
        }
        choosedStudentsForLab.Clear();
        foreach (ChangableButton studentChangableButton in studentChangableButtons)
        {
            if (studentChangableButton.IsActive)
            {
                choosedStudentsForLab.Add(studentChangableButton.studentId);
            }
        }
        DateTime currTime = DateTime.Now;

        choosedStudentsForLab.ForEach(choosedStudentForLab =>
        {
            Session newSession = new Session(MenuUIManager.currTeacherId, choosedStudentForLab, currTaskId,
                                             currTime, MenuUIManager.MinDateTime());
            var sessionsDB = new SessionsDB();
            sessionsDB.addSession(newSession);
            sessionsDB.close();
        });
        OpenTaskPanelMainMenu();
    }