Exemplo n.º 1
0
        public ActionResult Create(CreateEvaluationViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var createDomainModel = ConvertToDomainModel(viewModel);

                var newDomainModel = Evaluations.CreateNewEvaluation(createDomainModel);

                if (newDomainModel.GetType() == typeof(EvaluationDomainModel))
                {
                    Courses.EvaluationModified(viewModel.CourseId);

                    return(Complete((EvaluationDomainModel)newDomainModel));
                }
                else
                {
                    return(GradeTrackerError(newDomainModel, viewModel));
                }
            }
            else
            {
                return(View("AddEvaluation", viewModel));
            }
        }