public async void Refresh() { IsRefreshing = true; try { BJUTEduCenterUserinfo = _dbService.GetAll <Models.BJUTEduCenterUserinfo>().FirstOrDefault(); if (BJUTEduCenterUserinfo != null) { var gradeChart = await GetGrade(_studentName, BJUTEduCenterUserinfo.Username);//获取最新数据 if (gradeChart != null) { GradeChart.Clear(); GradeChart.MainList.Clear(); foreach (var item in gradeChart) { GradeChart.Add(item); } GradeChart.InitList(); SaveGradeChart();//保存成绩表 } } } catch { Services.NotityService.Notify("解析最新数据失败"); } finally { IsRefreshing = false; } }
public async void LoadGradeChart() { DAL.LocalSetting _localSetting = new DAL.LocalSetting(); var chart = await _localSetting.GetLocalInfo <Model.GradeChart>(typeof(Model.GradeChart).Name); lock (lockObject) { GradeChart = chart; } GradeChart?.InitList(); }
public void LoadGradeChart() { var list = _dbService.GetAll <Models.EduGradeItemModel>(); if (list != null) { foreach (var item in list) { GradeChart.Add(item); } } GradeChart.InitList(); }
public async Task <GradeChart> LoadGrade() { GradeChart gradeChart = null; await Task.Run(() => { gradeChart = new GradeChart(); foreach (var item in EduGradePageViewModel.GradePageVM.GradeChart) { EduGradeItemModel model = new EduGradeItemModel(); model.Subject = item.Subject; model.Score = item.Score; model.Credit = item.Credit; model.SchoolYear = item.SchoolYear; model.Term = item.Term; gradeChart.Add(model); } gradeChart.InitList(); }); return(gradeChart); }