private void BtnExamItem_Click(object sender, EventArgs e) { var btn = (SimpleButton)sender; ExamItemEnum ExamItem = ExamItemEnum.CommonExamItem; if (btn.Text == "综合评判") { ExamItem = ExamItemEnum.CommonExamItem; } else if (btn.Text == "倒车入库") { ExamItem = ExamItemEnum.ReverseParking; } else if (btn.Text == "侧方停车") { ExamItem = ExamItemEnum.ParallelParking; } else if (btn.Text == "曲线行驶") { ExamItem = ExamItemEnum.QuarterTurning; } else if (btn.Text == "直角转弯") { ExamItem = ExamItemEnum.CurveDriving; } else if (btn.Text == "坡道起步") { ExamItem = ExamItemEnum.SlopeWayParkingAndStarting; } InitDeductionRule((int)ExamItem); }
private void btnExamItem_Click(object sender, EventArgs e) { //BtnClickBefore(sender, true); var btn = (SimpleButton)sender; ExamItemEnum ExamItem = ExamItemEnum.CommonExamItem; if (btn.Text == "倒车入库") { ExamItem = ExamItemEnum.ReverseParking; } else if (btn.Text == "侧方停车") { ExamItem = ExamItemEnum.ParallelParking; } else if (btn.Text == "曲线行驶") { ExamItem = ExamItemEnum.QuarterTurning; } else if (btn.Text == "直角转弯") { ExamItem = ExamItemEnum.CurveDriving; } else if (btn.Text == "坡道起步") { ExamItem = ExamItemEnum.SlopeWayParkingAndStarting; } SendMessage(CmdTypeEnum.EnterExamItem, ExamItem); }
/// <summary> /// 如果是通过项目 /// </summary> /// <param name="cmdType"></param> public void SendMessage(CmdTypeEnum cmdType, ExamItemEnum ExamItem = ExamItemEnum.CommonExamItem, DeductionRule rule = null) { if (CurrentExamCar == null) { MessageBox.Show("请分配考生", "监考大厅"); return; } ExamMessage message = new ExamMessage(); message.ExamStudent = CurrentExamCar.ExamStudent; message.SendTime = DateTime.Now; message.CmdType = cmdType; message.ExamItem = ExamItem; if (message.CmdType == CmdTypeEnum.BreakeRule) { //发送扣分 message.DeductionRule = new ExamMessageDeductionRule(); message.DeductionRule.ExamItemId = rule.ExamItemId; message.DeductionRule.RuleCode = rule.RuleCode; message.DeductionRule.RuleName = rule.RuleName; message.DeductionRule.ExamItemName = rule.ExamItemName; message.DeductionRule.SubRuleCode = rule.SubRuleCode; message.DeductionRule.DeductedScores = rule.DeductedScores; } // message.DeductionRule = rule; var msg = JsonConvert.SerializeObject(message); //消息以Upd的行驶发出去 udpServer.Send(msg, CurrentExamCar.Ip, CurrentExamCar.Port); }
/// <summary> /// 如果是通过项目 /// </summary> /// <param name="cmdType"></param> public void SendMessage(CmdTypeEnum cmdType, ExamItemEnum ExamItem = ExamItemEnum.CommonExamItem, DeductionRule rule = null) { if (CurrentExamCar == null) { MessageBox.Show("请分配考生", "监考大厅"); return; } ExamMessage message = new ExamMessage(); //我其实是依赖与这个给考生赋值 message.ExamStudent = CurrentExamCar.ExamStudent; if (cmdType != CmdTypeEnum.SendExamStudentInfo) { message.ExamStudent.IDCardImage = null; } if (cmdType == CmdTypeEnum.SendExamStudentInfo) { //如果照片被清空 直接取指定路径读取照片 if (message.ExamStudent.IDCardImage == null) { //直接还思路 message.ExamStudent.IDCardImage = GetIDCardByte(); } } //直接再界面取怎么样? message.SendTime = DateTime.Now; message.CmdType = cmdType; message.ExamItem = ExamItem; if (cmdType == CmdTypeEnum.BreakeRule) { //发送扣分 message.DeductionRule = new ExamMessageDeductionRule(); message.DeductionRule.ExamItemId = rule.ExamItemId; message.DeductionRule.RuleCode = rule.RuleCode; message.DeductionRule.RuleName = rule.RuleName; message.DeductionRule.ExamItemName = rule.ExamItemName; message.DeductionRule.SubRuleCode = rule.SubRuleCode; message.DeductionRule.DeductedScores = rule.DeductedScores; } // message.DeductionRule = rule; var msg = JsonConvert.SerializeObject(message); //消息以Upd的行驶发出去 // //todo:我终于也用上了GitHub了 //todo:这个还是需要考虑进行优化的 //todo:可以考虑是用框架 看看性能各方面如何 this.udpCarSignalSeedV4.SocketSend(msg, Position); // udpServer.Send(msg, CurrentExamCar.Ip, CurrentExamCar.Port); }
public int GetParentItemCode(ExamItemEnum examItem) { var result = examItemRepository.LoadEntitiy(s => s.ItemCode == (int)examItem); return(result.ParentItemCode.HasValue ? result.ParentItemCode.Value : 0); }
public ProjectThrough GetProjectThroughs(int ExamRecordId, ExamItemEnum ItemCode) { var result = projectThroughRepository.LoadEntitiy(s => s.ExamItemItemCode == (int)ItemCode && s.ExamRecordId == ExamRecordId); return(result); }
public ExamItem GetExamItem(ExamItemEnum examItem) { var entity = examItemRepository.LoadEntitiy(s => s.ItemCode == (int)examItem); return(entity); }