コード例 #1
0
        public async Task Delete(EnrolmentUpdate enrolment)
        {
            ValidationErrors = null;
            try
            {
                await _enrolmentService.Delete(enrolment.Id);

                Enrolments.RowEditOptions.EditRowId = null;
                Enrolments.RequestRefresh();
            }
            catch (ValidationException ve)
            {
                ValidationErrors = ve.Errors.ToList();
            }
        }
コード例 #2
0
        public async Task SaveEdit(EnrolmentUpdate enrolment)
        {
            ValidationErrors = null;
            try
            {
                await _enrolmentService.Update(enrolment.Id, enrolment);

                Enrolments.RowEditOptions.EditRowId = null;
                Enrolments.RequestRefresh();
            }
            catch (ValidationPropertyException vpe)
            {
                ValidationErrors = vpe.ErrorsList.ToList();
            }
            catch (ValidationException ve)
            {
                ValidationErrors = ve.Errors.ToList();
            }
        }
コード例 #3
0
        public async Task ForceSave()
        {
            ValidationErrors = null;
            try
            {
                await _enrolmentService.UpdateAndCreate(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();
            }
        }
コード例 #4
0
 public void CancelEdit()
 {
     Enrolments.RowEditOptions.EditRowId = null;
     Enrolments.RequestRefresh();
 }