protected override void OnExamItemStateChanged(ExamItemStateChangedMessage message) { try { //特殊 这个版本综合评判状态也要加入 examItemStateChangedMessage = message; var AllExamItems = dataService.GetExamItemsList(true); Logger.Error(message.ExamItem.ItemCode); examItemProcess = examProcess.GetExamProcess(message.ExamItem.ItemCode); if (examItemProcess == null) { examItemProcess = new ExamItemProcess(); } examItemProcess.ExamItemCodes = message.ExamItem.ItemCode; examItemProcess.ExamItemName = message.ExamItem.Name; for (var i = 0; i < AllExamItems.Count(); i++) { if (AllExamItems[i].ItemCode == message.ExamItem.ItemCode) { //项目开始 if (ExamItemState.Progressing == message.NewState) { examItemProcess.BeginTime = DateTime.Now; examItemProcess.Status = ExamItemSatatus.Process; } //项目结束 else if (ExamItemState.Finished == message.NewState) { examItemProcess.EndTime = DateTime.Now; examItemProcess.Status = ExamItemSatatus.Finish; } examProcess.AddExamItem(examItemProcess); } } base.OnExamItemStateChanged(message); //考试状态改变 RunOnUiThread(ExamItemChange); } catch (Exception ex) { Logger.Error(ex, this.GetType().ToString()); } // base.OnExamItemStateChanged(message); }
protected override void ShowBrokenRule() { try { BrokenRuleInfo RuleInfo = brokenRuleMessage.RuleInfo; var index = lstExamItem.ToList().IndexOf(RuleInfo.ExamItemName); var CurrentExamItemProcess = examProcess.GetExamProcess(RuleInfo.ExamItemCode); if (CurrentExamItemProcess == null) { CurrentExamItemProcess = new ExamItemProcess(); } CurrentExamItemProcess.IsSuccess = false; examProcess.AddExamItem(CurrentExamItemProcess); index = index > 0 ? index * 2 : index; mainLinerLayout = (LinearLayout)this.FindViewById(Resource.Id.ExamItemTable); //通过索引获取子View var examItemView = (LinearLayout)mainLinerLayout.GetChildAt(index); imgExamStatus = examItemView.FindViewById <ImageView>(Resource.Id.imgExamStatus); tvExamInfo = examItemView.FindViewById <TextView>(Resource.Id.tvExamInfo); imgExamStatus.SetImageResource(imgExamFailResId); tvExamInfo.Text = GetExamInfo(RuleInfo.DeductedScores); //添加扣分规则 linearLayout = (LinearLayout)LayoutInflater.From(this).Inflate(Resource.Layout.tableKeFeiTeBreakeRule, null); tvExamCode = linearLayout.FindViewById <TextView>(Resource.Id.tvExamCode); tvRuleScore = linearLayout.FindViewById <TextView>(Resource.Id.tvRuleScore); tvRuleContent = linearLayout.FindViewById <TextView>(Resource.Id.tvRuleContent); tvExamCode.Text = RuleInfo.ExamItemCode; tvRuleScore.Text = RuleInfo.DeductedScores.ToString(); tvRuleContent.Text = RuleInfo.RuleName; examItemView.AddView(linearLayout); } catch (Exception ex) { Logger.Error(ex, this.GetType().ToString()); } }