コード例 #1
0
        private void OK_Click_1(object sender, EventArgs e)
        {
            #region

            if (SetAnswer() != null)
            {
                var sure = MessageBox.Show("Are You Sure " + SetAnswer() + " is the Answer ?", "Confirm",
                                           MessageBoxButtons.YesNo);
                if (sure != DialogResult.Yes)
                {
                    return;
                }

                InsertAnswer(SetAnswer(), Question.Id, _stateService.CurrentlyLoggedInUser().Id);
                if (QuestionsStack.Count() != 0)
                {
                    GetQuestion();
                    OptionState();
                }
                else
                {
                    var complete = MessageBox.Show("You Have Successfully Completed the Test", "Confirm",
                                                   MessageBoxButtons.OK);
                    if (complete == DialogResult.OK)
                    {
                        var userResult = Program.CreateServiceProvider().GetRequiredService <UserResult>();
                        userResult.ShowDialog();
                        Close();
                    }
                }
            }

            #endregion
        }
コード例 #2
0
ファイル: UserResult.cs プロジェクト: duhowise/ExamSystem
        public UserResult(TestEvaluationService testEvaluationService, ApplicationUserStateService applicationUserStateService, TestService testService)
        {
            InitializeComponent();

            _testEvaluationService = testEvaluationService;
            _testService           = testService;
            _currentUser           = applicationUserStateService.CurrentlyLoggedInUser();
            TestId     = applicationUserStateService.GetTestId();
            this.Load += UserResult_Load;
        }