Exemplo n.º 1
0
        public UCtrlExamCode()
        {
            InitializeComponent();

            dgvExaminee.AutoGenerateColumns = false;

            _examineeFailureBLL = new ExamineeFailureBLL();
            _examineeTakeBLL    = new ExamineeTakeBLL();
        }
Exemplo n.º 2
0
        public FrmExamResult(int examineeId)
        {
            InitializeComponent();

            dgvSubjResult.AutoGenerateColumns = false;

            _examineeId = examineeId;

            _examineeTakeBLL         = new ExamineeTakeBLL();
            _examResultViewModelList = _examineeTakeBLL.GetExamResultByExamineeId(_examineeId);

            foreach (var codes in _examResultViewModelList)
            {
                cboExamCode.Items.Add(codes.ExamCode);
            }
        }
Exemplo n.º 3
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            FrmReport frmReport = new FrmReport();

            if (cboReport.SelectedIndex == 0)   //  exam result
            {
                ExamineeTakeBLL         examineeTakeBLL  = new ExamineeTakeBLL();
                List <ExamResultReport> examResult       = new List <ExamResultReport>();
                ReportParameter[]       reportParameters = new ReportParameter[1];

                if (rdbIn.Checked)
                {
                    examResult          = examineeTakeBLL.GetExamResultList(chkInclude.Checked, dtpIn.Value, null);
                    reportParameters[0] = new ReportParameter("ExamResultDate", "Exam result in " + dtpIn.Value.ToShortDateString());
                }
                else if (rdbFrom.Checked)
                {
                    examResult          = examineeTakeBLL.GetExamResultList(chkInclude.Checked, dtpFrom.Value, dtpTo.Value);
                    reportParameters[0] = new ReportParameter("ExamResultDate", "Exam result from " + dtpFrom.Value.ToShortDateString() + " to " + dtpTo.Value.Date.ToShortDateString());
                }

                frmReport.LoadReport("ExamResultDS", examResult, "PresentationLayer.Reports.ExamResultReport.rdlc", reportParameters);
            }
            else if (cboReport.SelectedIndex == 1)  //  examinee list
            {
                ExamineeBLL           examineeBLL      = new ExamineeBLL();
                List <ExamineeReport> examineeReport   = new List <ExamineeReport>();
                ReportParameter[]     reportParameters = new ReportParameter[1];

                if (rdbIn.Checked)
                {
                    examineeReport      = examineeBLL.GetExamineeList(dtpIn.Value, null);
                    reportParameters[0] = new ReportParameter("ExamineeDate", "Examinees registered/added in " + dtpIn.Value.ToShortDateString());
                }
                else if (rdbFrom.Checked)
                {
                    examineeReport      = examineeBLL.GetExamineeList(dtpFrom.Value, dtpTo.Value);
                    reportParameters[0] = new ReportParameter("ExamineeDate", "Examinees registered/added from " + dtpFrom.Value.ToShortDateString() + " to " + dtpTo.Value.Date.ToShortDateString());
                }

                frmReport.LoadReport("ExamineeDS", examineeReport, "PresentationLayer.Reports.ExamineeReport.rdlc", reportParameters);
            }

            frmReport.ShowDialog(this);
        }
        private void SetQuestion()
        {
            _examItemCount = _examList.Single(e => e.ExamId == _examId).ItemCount;
            int examCount = _examList.Count;

            if (_questionNumber < _examItemCount)
            {
                _counter++;
                SetExaminationInfo();
                SetQuestionLabelText();
                SetChoice();
            }
            else
            {
                _subjectScoreList.Add(new SubjectScore
                {
                    SubjectName = _examList.Single(e => e.ExamId == _examId).Subject.SubjectName,
                    Score       = _examScore,
                    ItemCount   = _examItemCount
                });

                _examineeExamList[_index].Score = _examScore;   //  set score in exam taken
                _questionNumber = 0;
                _index++;
                _examScore = 0; //  reset score
                _counter   = 1; //  reset counter

                if (_index < examCount)
                {
                    _examId        = _examineeExamList[_index].ExamId;
                    _examItemCount = _examList.Single(e => e.ExamId == _examId).ItemCount;

                    SetExaminationInfo();
                    SetQuestionLabelText();
                    SetChoice();
                }
                else
                {
                    _doLoop        = false;
                    _timer.Enabled = false;

                    this.Visible = false;

                    _passingRateBLL = new PassingRateBLL();
                    _examineeTakeInfo.PassingRate = _passingRateBLL.GetCurrentPassingRate();

                    var examScoreSummary = _subjectScoreList
                                           .GroupBy(g => new
                    {
                        g.SubjectName,
                    })
                                           .Select(s => new
                    {
                        s.Key.SubjectName,
                        ItemCount  = s.Sum(ic => ic.ItemCount),
                        TotalScore = s.Sum(ts => ts.Score),
                        Result     = s.Sum(ts => ts.Score) >= Math.Ceiling(Compute.GetPercentage((double)_examineeTakeInfo.PassingRate, s.Sum(ic => ic.ItemCount))) ? true : false
                                     //,View = s.Sum(ts => ts.Score) + " >= " + Math.Ceiling(Compute.GetPercentage((double)_examineeTakeInfo.PassingRate, s.Sum(ic => ic.ItemCount)))
                    });

                    //foreach (var item in examScoreSummary)
                    //{
                    //    Console.WriteLine("Items: " + item.ItemCount + "     Score:" + item.TotalScore + "   |View:" + item.View);
                    //}

                    bool passedExam = examScoreSummary.Where(e => e.Result == false).Count() == 0;   //  if list got no failed(false) exam score
                    _examineeTakeInfo.Result = passedExam;

                    _examineeTakeBLL = new ExamineeTakeBLL();
                    _examineeTakeBLL.UpdateExamineeTake(_examineeTakeInfo);

                    _examineeBLL = new ExamineeBLL();
                    _examineeBLL.IncreaseExamineeExamTaken(_examineeTakeInfo.ExamineeId);

                    FrmCounter frmCounter = new FrmCounter("Your Exam Ends In...");
                    frmCounter.ShowDialog(this);
                    this.Close();
                }
            }
        }
Exemplo n.º 5
0
        public FrmExamResultDetails()
        {
            InitializeComponent();

            _examineeTakeBLL = new ExamineeTakeBLL();
        }