/// <summary> /// 更新设备状态为空闲、插入已考试科目ID与子项ID、删除当前子项考试过程记录 /// </summary> /// <returns>EnumSubmitResult</returns> public static EnumSubmitResult UpdateDeviceStatusCallListDeleteExamProcess(int iExamineeID) { EnumSubmitResult enmResult = EnumSubmitResult.Failed; string strIP = GetLocalIP(); if (strIP != "") { JAAJ_DeviceInfo odiDeviceInfo = GetDeviceInfoByIP(strIP); JAAJ_ExamProceInfo oepiExamProceInfo = GetExamProceInfoByExamineeID(iExamineeID); if (oepiExamProceInfo != null) { JAAJ_SubjectItemInfo osiiSubjectItemInfo = GetSubjectItemInfoByID(oepiExamProceInfo.iSubjectItemID); if (odiDeviceInfo != null && osiiSubjectItemInfo != null) { string strStoreProcedure = "JAAJ_UpdateDeviceStatusCallListDeleteExamProcess"; SqlDatabase odbDataBase = new SqlDatabase(connectionString); DbCommand odbCommand = odbDataBase.GetStoredProcCommand(strStoreProcedure); odbDataBase.AddInParameter(odbCommand, "@iExamineeID", System.Data.DbType.Int32, iExamineeID); odbDataBase.AddInParameter(odbCommand, "@iSubjectID", System.Data.DbType.Int32, osiiSubjectItemInfo.iSubjectID); odbDataBase.AddInParameter(odbCommand, "@iSubjectItemID", System.Data.DbType.Int32, osiiSubjectItemInfo.iSubjectItemID); odbDataBase.AddInParameter(odbCommand, "@iDeviceID", System.Data.DbType.Int32, odiDeviceInfo.iDeviceID); odbDataBase.AddOutParameter(odbCommand, "@result", System.Data.DbType.Int32, 8); using (IDbConnection connection = odbDataBase.CreateConnection()) { connection.Open(); try { odbDataBase.ExecuteNonQuery(odbCommand); int i = int.Parse(odbCommand.Parameters["@result"].Value.ToString()); enmResult = (EnumSubmitResult)i; } catch (Exception oeException) { //throw new Exception(oeException.Message, oeException); } connection.Close(); } odbCommand.Dispose(); } } } return(enmResult); }
/// <summary> /// 获取科目子项实体 /// </summary> /// <param name="iSubjectItemID">科目子项ID</param> /// <returns>科目子项实体,JAAJ_SubjectItemInfo</returns> public static JAAJ_SubjectItemInfo GetSubjectItemInfoByID(int iSubjectItemID) { string strSqlString = "SELECT * FROM JAAJ_SubjectItems WHERE iSubjectItemID=" + iSubjectItemID + " "; SqlDatabase odbDataBase = new SqlDatabase(connectionString); DbCommand odbCommand = odbDataBase.GetSqlStringCommand(strSqlString); JAAJ_SubjectItemInfo oInfo = null; try { using (IDataReader reader = odbDataBase.ExecuteReader(odbCommand)) { if (reader.Read()) { oInfo = new JAAJ_SubjectItemInfo(); ModelHelper.LoadInfoData(oInfo, reader); } } } catch (Exception oeException) { throw new Exception(oeException.Message, oeException); } return(oInfo); }
/// <summary> /// 解析成绩XML保存考生成绩 /// </summary> /// <param name="nvcBatchNO">批次号</param> /// <param name="iExamineeID">考生ID</param> public void SaveScore(string nvcBatchNO, int iExamineeID) { oepiExamProceInfo = ScoreData.GetExamProceInfoByExamineeID(iExamineeID); if (oepiExamProceInfo != null) { //int iSubjectItemID = oepiExamProceInfo.iSubjectItemID; //下面代码可以根据科目子项ID调出对应的子项对应的试题..... BaseInfo obiBaseInfo = JAAJExamManagementSys.Common.CurrentScoreFieldsSetting; foreach (SubjectItem osiSubjectItem in obiBaseInfo.SubjectItemList) { JAAJ_SubjectItemInfo osiiSubjectItemInfo = ScoreData.GetSubjectItemInfoByID(oepiExamProceInfo.iSubjectItemID); if (osiiSubjectItemInfo != null) { #region 给子项分值赋值 ossiJAAJ_SubjectScoreInfo = new JAAJ_SubjectScoreInfo(); ossiJAAJ_SubjectScoreInfo.nvcBatchNO = nvcBatchNO; //批次号 ossiJAAJ_SubjectScoreInfo.iExamineeID = iExamineeID; //考生ID,从考生表查 ossiJAAJ_SubjectScoreInfo.iSubjectID = osiiSubjectItemInfo.iSubjectID; ossiJAAJ_SubjectScoreInfo.iSubjectItemID = osiiSubjectItemInfo.iSubjectItemID; ossiJAAJ_SubjectScoreInfo.decSubjectScore = osiSubjectItem.SubjectItemScore; //考生本次考试所考子项总分值 ossiJAAJ_SubjectScoreInfo.datScoreDate = DateTime.Now; ossiJAAJ_SubjectScoreInfo.nvcMemo = ""; #endregion foreach (Title otTitle in osiSubjectItem.TitleList[0].TitleList) { #region 加入试题成绩 JAAJ_SubItemScoreInfo osisiJAAJ_SubItemScoreInfo = new JAAJ_SubItemScoreInfo(); osisiJAAJ_SubItemScoreInfo.iExamineeID = iExamineeID; //需要根据身份证号查出赋值 osisiJAAJ_SubItemScoreInfo.iTitleID = 0; osisiJAAJ_SubItemScoreInfo.nvcTitleName = otTitle.TitleName; osisiJAAJ_SubItemScoreInfo.nvcDescription = otTitle.TitleDescription; osisiJAAJ_SubItemScoreInfo.decSubjectItemScore = otTitle.TitleScore; //本道题本次考试所得分值 osisiJAAJ_SubItemScoreInfo.nvcMemo = ""; #endregion #region 循环加入试题对应的步骤成绩 if (otTitle.StepList.Count > 0) { foreach (Step osStep in otTitle.StepList[0].StepList) { JAAJ_StepScoreInfo ossiJAAJ_StepScoreInfo = new JAAJ_StepScoreInfo(); ossiJAAJ_StepScoreInfo.nvcStepName = osStep.StepName; ossiJAAJ_StepScoreInfo.nvcDescription = osStep.StepDescription; ossiJAAJ_StepScoreInfo.decStepScore = osStep.StepScore; //本步骤本次考试所得分值 ossiJAAJ_StepScoreInfo.nvcMemo = ""; osisiJAAJ_SubItemScoreInfo.JAAJ_StepScoreInfoList.Add(ossiJAAJ_StepScoreInfo); } } #endregion osisiJAAJ_SubItemScoreInfoList.Add(osisiJAAJ_SubItemScoreInfo); } EnumSubmitResult enResult = ScoreData.Save(ossiJAAJ_SubjectScoreInfo, osisiJAAJ_SubItemScoreInfoList); if (enResult == EnumSubmitResult.Success) { //MessageBox.Show("分值提交成功", "提示"); } else { //MessageBox.Show("分值提交失败", "提示"); } } } } }
public void SaveScore() { //本次考题得分总数; int FireSum = 0; //第一步分数; int OneFire = 0;; //第二步骤得分; int twoFire = 0; //判断着火的类型与灭火器选择的分数; //String //FireStruct.sFireType = s[2];//着火的类型 1:水基灭火 int nTemp = 0; if (nTemp == 0) { OneFire = 15; } else { OneFire = 0; } //是否成功对准火焰根部灭火; int nTemp1 = 0; if (nTemp1 == 0) { twoFire = 10; } else { twoFire = 0; } FireSum = twoFire + OneFire; string sFireSum = Convert.ToString(FireSum); sFireSum = "本次灭火总成绩:" + sFireSum; JAAJ_SubjectItemInfo osiiSubjectItemInfo = ScoreData.GetSubjectItemInfoByID(oepiExamProceInfo.iSubjectItemID); if (osiiSubjectItemInfo != null) { #region 给子项总分值赋值 //给子项总分值赋值 ossiJAAJ_SubjectScoreInfo = new JAAJ_SubjectScoreInfo(); ossiJAAJ_SubjectScoreInfo.nvcBatchNO = oeiJAAJ_ExamineeInfo.nvcBatchNO; ossiJAAJ_SubjectScoreInfo.iExamineeID = oeiJAAJ_ExamineeInfo.iExamineeID; ossiJAAJ_SubjectScoreInfo.iSubjectID = osiiSubjectItemInfo.iSubjectID; ossiJAAJ_SubjectScoreInfo.iSubjectItemID = osiiSubjectItemInfo.iSubjectItemID; ossiJAAJ_SubjectScoreInfo.decSubjectScore = FireSum; //考生本次考试所考子项总分值 ossiJAAJ_SubjectScoreInfo.datScoreDate = DateTime.Now; ossiJAAJ_SubjectScoreInfo.nvcMemo = ""; #endregion #region 第一题 //第一题 JAAJ_SubItemScoreInfo osisiJAAJ_SubItemScoreInfo = new JAAJ_SubItemScoreInfo(); osisiJAAJ_SubItemScoreInfo.iExamineeID = oeiJAAJ_ExamineeInfo.iExamineeID; osisiJAAJ_SubItemScoreInfo.iTitleID = 0; osisiJAAJ_SubItemScoreInfo.nvcTitleName = "厨房灭火"; osisiJAAJ_SubItemScoreInfo.nvcDescription = "厨房灭火"; osisiJAAJ_SubItemScoreInfo.decSubjectItemScore = FireSum; //本道题本次考试所得分值 osisiJAAJ_SubItemScoreInfo.nvcMemo = ""; #region 第一题试题步骤实体集赋值 #region 第一步骤 JAAJ_StepScoreInfo ossiJAAJ_StepScoreInfo = new JAAJ_StepScoreInfo(); ossiJAAJ_StepScoreInfo.nvcStepName = "灭火器选择"; ossiJAAJ_StepScoreInfo.nvcDescription = "灭火器选择"; ossiJAAJ_StepScoreInfo.decStepScore = OneFire;//本步骤本次考试所得分值 ossiJAAJ_StepScoreInfo.nvcMemo = ""; osisiJAAJ_SubItemScoreInfo.JAAJ_StepScoreInfoList.Add(ossiJAAJ_StepScoreInfo); #endregion #region 第二步骤 ossiJAAJ_StepScoreInfo = new JAAJ_StepScoreInfo(); ossiJAAJ_StepScoreInfo.nvcStepName = "是否对准火焰根部,开始灭火"; ossiJAAJ_StepScoreInfo.nvcDescription = "是否对准火焰根部,开始灭火"; ossiJAAJ_StepScoreInfo.decStepScore = twoFire;//本步骤本次考试所得分值 ossiJAAJ_StepScoreInfo.nvcMemo = ""; osisiJAAJ_SubItemScoreInfo.JAAJ_StepScoreInfoList.Add(ossiJAAJ_StepScoreInfo); #endregion #endregion osisiJAAJ_SubItemScoreInfoList.Add(osisiJAAJ_SubItemScoreInfo); #endregion EnumSubmitResult enResult = ScoreData.Save(ossiJAAJ_SubjectScoreInfo, osisiJAAJ_SubItemScoreInfoList); if (enResult == EnumSubmitResult.Success) { //MessageBox.Show("分值提交成功", "提示"); } else { //MessageBox.Show("分值提交失败", "提示"); } } }