internal void CheckOnStartUp() { _info = (new BLL()).GetRightNowInfo(); int atRound = _info.AtRound; List <TeamModel.Team> teams = _info.TeamsRightNow; if (atRound == 1) { if (teams[0].Round1State == "examing") { //throw new ApplicationException(); _view.Close(); MessageBox.Show("Vòng " + atRound + ". \nKết nối trong khi có đội đang thi.\nTriển khai phương án dự phòng.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (teams[0].Round1State == "yet") { return; } if (teams[0].Round1State == "pending") { V_MC_Vong1 vV1Pending = new V_MC_Vong1(); View preView = this._view; // vV1Pending.Controller = this; this._view = vV1Pending; // preView.Close(); //vV1Pending.Show(); //vStart.Hide(); this._view.ShowDialog(); // // vStart.tmr3dot.Stop(); //vStart.tmr3dot.Enabled = false; //vStart.Hide(); return; } throw new ApplicationException(); } else if (atRound == 2) { return; } else if (atRound == 3) { throw new NotImplementedException(); } throw new InvalidOperationException(); //throw new NotImplementedException(); }
private void UpdateView(Question nextQues, bool isShownAnswerkey) { //throw new NotImplementedException(); if (_view is V_MC_Vong1) { V_MC_Vong1 myView = _view as V_MC_Vong1; if (nextQues == null)// het cau hoi vong nay { return; //// /// } if (nextQues is Compound) { Compound ques = nextQues as Compound; myView.QuestionText = ques.QuestionContent + "\nA." + ques.ChoiceA + "\nB." + ques.ChoiceB + "\nC." + ques.ChoiceC + "\nD." + ques.ChoiceD; } else if (nextQues is Multiple_Choice) { Multiple_Choice ques = nextQues as Multiple_Choice; myView.QuestionText = ques.QuestionContent + "\nA." + ques.ChoiceA + "\nB." + ques.ChoiceB + "\nC." + ques.ChoiceC + "\nD." + ques.ChoiceD; } else if (nextQues is Fill_In) { Fill_In ques = nextQues as Fill_In; myView.QuestionText = ques.QuestionContent.Replace("NNN", "..."); } else { myView.QuestionText = nextQues.QuestionContent; } myView.QuestionNumText = nextQues.STT; try { myView.AnswerKey = nextQues.AnswerKey; } catch { } } }
public MC_Vong1_Controller(V_MC_Vong1 v) : base(v) { v.Load += V_Load; }
public App(V_MC_Vong1 view) { _view = view; _controller = new MC_Vong1_Controller(view); _view.Controller = _controller; }