示例#1
0
        /// <summary>
        /// 提交完成
        /// 并进入结果显示
        /// </summary>
        private void GoToResultView()
        {
            CompleteExamModel model = new CompleteExamModel()
            {
                exam_attend_id =
                    (string.IsNullOrEmpty(GlobalUser.AttendPaperItemId) || GlobalUser.SelectExamAttend.exam_attend_id < 1)
                        ? GlobalUser.AttendPaperItemId
                        : GlobalUser.SelectExamAttend.exam_attend_id.ToString(),
            };

            ApiType api = ApiType.CompleteExam;

            if (GlobalUser.MenuType == MenuType.Task)
            {
                api = ApiType.CompleteUserTask;
            }

            //完成练习 作业 训练
            var result = WebApiProxy.GetHtmlRespInfo(model, api, GlobalUser.USER.Token);

            if (result.retCode == 0)
            {
                _dispatcherTimer.Stop();

                //移除 ErrScore结果数据
                GlobalUser.CheckErrorScoreSource(User.Mobile,
                                                 GlobalUser.SelectPaperNumber.Split(new[] { "#" }, StringSplitOptions.RemoveEmptyEntries)[0],
                                                 GlobalUser.AttendPaperItemId, true);

                this.Cleanup();
                GlobalUser.DoneItemExam = true;
                BindExamResultUC();
            }
            else
            {
                _dispatcherTimer.Stop();

                //操作失败
                //todo
                ResubmitAnswerDialog dialog = new ResubmitAnswerDialog();

                DialogHost.Show(dialog, "ExamMainDialog"); //ResubmitDialogClosingEventHandler

                ErrMsgLog msgInfo = new ErrMsgLog();
                msgInfo.user    = GlobalUser.USER.Mobile;
                msgInfo.msginfo = "作答正常完成,提交 Complete 失败";
                msgInfo.error   = result.retHtml;
                msgInfo.isErr   = true;
                Log4NetHelper.Error(msgInfo
                                    .ToJson()); //$"[user:{GlobalUser.USER?.Mobile},msg:作答正常完成,未正常返回统计消息,data:{result.retHtml}]");

                {
                    Log_Data log = new Log_Data();
                    log.log_desc = Log_Type.PC_Complete_Error.ToString();
                    log.log_text =
                        msgInfo.ToJson(); //$"[user:{GlobalUser.USER?.Mobile},msg:作答正常完成,未正常返回统计消息,data:{result.retHtml}]";// $"{GlobalUser.USER?.Mobile}-作答正常完成,未正常返回统计消息---{result.retMsg}";
                    log.log_device = JsonHelper.ToJson(GlobalUser.MACHINEINFO.GetDevice());
                    WebApiProxy.GetHtmlRespInfo(log, ApiType.SysLog, null, "Post");
                }
            }
        }