public void RefreshData() { var schoolName = GetUserContext().SchoolName; var schoolsRealm = new SchoolsRealm(); var currentSchool = schoolsRealm.Get(x => x.Name == schoolName); var classesRealm = new ClassesRealm(); var classes = classesRealm.GetAll(x => x.School == currentSchool).ToList(); var classesContainer = new List <Class>(); foreach (var entity in classes) { classesContainer.Add(entity); } Classes.Clear(); Classes.AddRange(classesContainer); }
public override void RefreshData() { ClassModel = ClassesRealm.Get(ClassLocalId); var currentProfile = GetCurrentUser().Profile; AttendanceModel = AttendanceRealm.GetRealmResults() .Where(x => x.Date == Date) .FirstOrDefault(x => x.Profile == currentProfile); var canceledRealm = new Domain.Services.Realms.CanceledClasses(); CanceledModel = canceledRealm.GetRealmResults().Where(x => x.Class == ClassModel).FirstOrDefault(x => x.Date == Date); if (CanceledModel != null) { IsCanceled = CanceledModel.IsCanceled; } GetAttendants(); }