예제 #1
0
        public ActionResult Index()
        {
            List <TestModel> list = new List <TestModel>();

            foreach (var item in serviceTest.GetAll())
            {
                TestModel fv = new TestModel();


                fv.testId      = item.testId;
                fv.type        = item.type;
                fv.question    = item.question;
                fv.reponse     = item.reponse;
                fv.choix1      = item.choix1;
                fv.choix2      = item.choix2;
                fv.IsCheckedR  = false;
                fv.IsCheckedR1 = false;
                fv.IsCheckedR2 = false;

                list.Add(fv);
            }


            return(View(list));
        }
        // GET: Lettre
        public ActionResult Report()
        {
            List <Test>  tests  = serviceTest.GetAll().ToList();
            LettreReport lettre = new LettreReport();

            byte[] abytes = lettre.PrepareReport(tests);

            return(File(abytes, "application/pdf"));
        }
예제 #3
0
        // GET: api/Tests
        public IEnumerable <TestModel> GetTests()
        {
            var tests            = cs.GetAll();
            List <TestModel> lpm = new List <TestModel>();

            foreach (var item in tests)
            {
                lpm.Add(new TestModel
                {
                    testId   = item.testId,
                    type     = item.type,
                    question = item.question,
                    reponse  = item.reponse,
                    choix1   = item.choix1,
                    choix2   = item.choix2
                });
            }
            return(lpm);
        }