예제 #1
0
 public MainPage()
 {
     this.InitializeComponent();
     Question        = new QuestionViewModel(new Question(" ", new Answer(""), new Answer(""), new Answer(""), new Answer(""), 0));
     QuestionBank    = new QuestionBankViewModel(new QuestionBank());
     Quiz            = new QuizViewModel(new Quiz(""));
     Answer1         = new AnswerViewModel(new Answer(""));
     Answer2         = new AnswerViewModel(new Answer(""));
     Answer3         = new AnswerViewModel(new Answer(""));
     Answer4         = new AnswerViewModel(new Answer(""));
     selecetedAnswer = 1;
 }
예제 #2
0
        public ActionResult QuestionBankGVPDelete([ModelBinder(typeof(DevExpressEditorsBinder))] System.Int32 Id)
        {
            if (Id >= 0)
            {
                try
                {
                    // Insert here a code to delete the QuestionBank from your model
                    var QuestionBank = QuestionBankViewModel.Find(Id);
                    QuestionBank.Delete();
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            var model = QuestionBankViewModel.GetQuestionBankList();

            return(PartialView(QuestionBankView, model));
        }
예제 #3
0
        public ActionResult QuestionBankGVPUpdate([ModelBinder(typeof(DevExpressEditorsBinder))]  QuestionBankViewModel QuestionBank)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    // Insert here a code to update the QuestionBank in your model
                    QuestionBank.Update();
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = QuestionBank.GetModelStateError(ModelState);
            }
            var model = QuestionBankViewModel.GetQuestionBankList();

            return(PartialView(QuestionBankView, model));
        }
예제 #4
0
        public ActionResult QuestionBankGVP()
        {
            var model = QuestionBankViewModel.GetQuestionBankList();

            return(PartialView(QuestionBankView, model));
        }