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 void LoadGradeChart()
        {
            var list = _dbService.GetAll <Models.EduGradeItemModel>();

            if (list != null)
            {
                foreach (var item in list)
                {
                    GradeChart.Add(item);
                }
            }
            GradeChart.InitList();
        }
Exemple #3
0
        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);
        }