Esempio n. 1
0
        public async Task SafeSave()
        {
            ValidationErrors = null;
            try
            {
                await _enrolmentService.CreateSafe(NewEnrolments.Select(_ => _.Enrolment).ToList());

                Context.RedirectToRoute("Enrolments");
            }
            catch (ValidationPropertyException vpe)
            {
                ValidationErrors = vpe.ErrorsList.ToList();
            }
            catch (ValidationException ve)
            {
                ValidationErrors = ve.Errors.ToList();
            }
        }
Esempio n. 2
0
        public async Task SafeSave()
        {
            ValidationErrors = null;
            try
            {
                await _enrolmentService.CreateSafe(NewEnrolments.Select(_ => _.Enrolment).ToList());

                Enrolments.RequestRefresh();
                NewEnrolments = null;
                CreateMode    = false;
                Enrolments.RowEditOptions.EditRowId = null;
            }
            catch (ValidationPropertyException vpe)
            {
                ValidationErrors = vpe.ErrorsList.ToList();
            }
            catch (ValidationException ve)
            {
                ValidationErrors = ve.Errors.ToList();
            }
        }