private async Task DoSaveStudent() { IsEditMode = false; if (SelectedStudentId != 0) { var student = new IO.Swagger.Model.Student( SelectedStudent.Id, SelectedStudentName, SelectedStudentGender, SelectedStudentLocation, SelectedStudentBirthday, SelectedStudentEnrollmentDate, SelectedStudentEnrollmentClass, SelectedStudentEnrollmentAcademicYear, SelectedStudentEnrollmentReason, SelectedStudentEnrollmentDate, SelectedStudentEnrollmentClass, SelectedStudentEnrollmentAcademicYear, SelectedStudentSchoolViewModel?.Id, SelectedStudentSponsorshipStatus ); await _edsWebApiService.UpdateStudent(SelectedStudent.Id, student); } else { var student = new IO.Swagger.Model.Student(0, SelectedStudentName, SelectedStudentGender, SelectedStudentLocation, SelectedStudentBirthday, SelectedStudentEnrollmentDate, SelectedStudentEnrollmentClass, SelectedStudentEnrollmentAcademicYear, SelectedStudentEnrollmentReason, SelectedStudentEnrollmentDate, SelectedStudentEnrollmentClass, SelectedStudentEnrollmentAcademicYear, SelectedStudentSchoolViewModel?.Id, SelectedStudentSponsorshipStatus ); await _edsWebApiService.AddStudent(student); } }
public StudentViewModel(IO.Swagger.Model.Student student) { _student = student; _confirmedSchoolClass = _student.ConfirmedClass.GetValueOrDefault(0); _currentSchoolClass = GetCurrentSchoolClass(_student.ConfirmedAcademicyear, _student.ConfirmedClass); }