Example #1
0
        public void FindAllExam(Pagination pagination, int userId)
        {
            if (!string.IsNullOrWhiteSpace(pagination.UserName))
            {
                this.txtSearchContent.Text = pagination.UserName;
            }
            this.pnlPaginationContainer.Controls.Clear();
            this.pnlDataContainer.Controls.Clear();
            client = new ExamService.ExamServiceClient();

            try
            {
                exams           = client.FindAllStudentExamResultByExamId(pagination, examId);
                this.pagination = client.GetStudentResultByExamIdPagination(pagination, examId);

                for (int i = 0; i < exams.Count; i++)
                {
                    examStudentResultDataLineControl        = new ExamStudentResultDataLineControl(exams[i]);
                    examStudentResultDataLineControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                                                    | System.Windows.Forms.AnchorStyles.Right)));
                    examStudentResultDataLineControl.Width    = this.pnlDataContainer.Width;
                    examStudentResultDataLineControl.Location = new Point(0, i * 31);
                    this.pnlDataContainer.Controls.Add(examStudentResultDataLineControl);
                }
                paginationControl = new PaginationControl(this.pagination, FindAllExam);
                this.pnlPaginationContainer.Controls.Add(paginationControl);
            }
            catch (FaultException <DBException> faultDbException)
            {
                ShowAlertWindow(faultDbException.Message);
            }
        }
Example #2
0
        private void ShowQuestionDeatil()
        {
            ExamService.ExamServiceClient client = new ExamService.ExamServiceClient();
            List <int> studentAnswers            = new ExamService.ExamServiceClient().SelectStudentSelfAnswer(SessionUtil.User.Id, exam.Id);

            for (int i = 0; i < studentAnswers.Count; i++)
            {
                ShowQuestionControl showQuestionControl = new ShowQuestionControl(questions[i], studentAnswers[i], i);
                showQuestionControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                                   | System.Windows.Forms.AnchorStyles.Right)));
                showQuestionControl.Location = new Point(0, i * 180);
                this.pnlQuestionsContainer.Controls.Add(showQuestionControl);
            }
        }
Example #3
0
        public void FindAllExam(Pagination pagination, int userId)
        {
            this.pnlPaginationContainer.Controls.Clear();
            this.pnlDataContainer.Controls.Clear();
            client = new ExamService.ExamServiceClient();
            try
            {
                exams           = client.TeacherFindAllExam(pagination);
                this.pagination = client.GetTeacherPagination(pagination);

                for (int i = 0; i < exams.Count; i++)
                {
                    dataLine        = new TeacherDataLineControl(exams[i]);
                    dataLine.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                            | System.Windows.Forms.AnchorStyles.Right)));
                    dataLine.Width    = this.pnlDataContainer.Width;
                    dataLine.Location = new Point(0, i * 31);
                    this.pnlDataContainer.Controls.Add(dataLine);
                }
                paginationControl = new PaginationControl(this.pagination, FindAllExam);
                this.pnlPaginationContainer.Controls.Add(paginationControl);
                if (!string.IsNullOrEmpty(pagination.ExamName))
                {
                    this.txtSearchContent.Text = pagination.ExamName;
                }
            }
            catch (FaultException <DBException> faultDbException)
            {
                ShowAlertWindow(faultDbException.Message);
            }
            catch (CommunicationException communicationException)
            {
                ShowAlertWindow(Constants.CannotConnServer);
            }
            catch (TimeoutException timeoutException)
            {
                ShowAlertWindow(Constants.NetworkTimeout);
            }
        }