Пример #1
0
        public ActionResult Create([Bind(Include = "Id,Evaluation_Id,Pupil_Id,Note")] Results results)
        {
            if (ModelState.IsValid)
            {
                results.Id = Guid.NewGuid();
                resultsRepository.Add(results);
                resultsRepository.Save();
                return(RedirectToAction("Index"));
            }

            ViewBag.Evaluation_Id = new SelectList(resultsRepository.GetAcademy().Evaluations, "Id", "Id", results.Evaluation_Id);
            ViewBag.Pupil_Id      = new SelectList(resultsRepository.GetAcademy().Pupils, "Id", "FirstName", results.Pupil_Id);
            return(View(results));
        }