예제 #1
0
        private async Task <bool> GetClassroomAsync()
        {
            try
            {
                //_imei = "BOX708BCD567E45";
                _imei = _meetingSdkAgent.GetSerialNo()?.Result;

                ReturnMessage bmsMessage = await _bmsService.GetClassroomAsync(_imei);

                if (bmsMessage.HasError)
                {
                    string errorMsg    = bmsMessage.Status == "-1" ? $"设备号:{_imei}未注册!" : bmsMessage.Message;
                    Dialog errorDialog = new Dialog(errorMsg);
                    errorDialog.ShowDialog();
                }
                else
                {
                    GlobalData.Instance.Classroom = bmsMessage.Data as Common.Model.Classroom;

                    var classTable = await _bmsService.GetClassTableInfoAsync(GlobalData.Instance.Classroom?.Id);

                    ClassScheduleModel.DoUpdateCurriculumMeetingN0(classTable);
                }
                return(!bmsMessage.HasError);
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"GetClassroom exception:{ex}");
                string errInfo     = MessageManager.ErrorGetClassroom + $"{ex.Message}";
                Dialog errorDialog = new Dialog(errInfo);
                errorDialog.ShowDialog();
                return(false);
            }
        }
예제 #2
0
        private async void GotoTimetable()
        {
            GlobalData.Instance.CurrentHomeMenu = MainMenuNames.Timetable;

            var classTable = await _classroomBms.GetClassTableInfoAsync(GlobalData.Instance.Classroom?.Id);

            ClassScheduleModel.DoUpdateCurriculumMeetingN0(classTable);

            var view = new ClassScheduleView();

            view.Show();
            _mainView.Close();
        }