Пример #1
0
        /// <summary>
        /// 开始考试
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            #region 验证考试是否应该参与考试
            JAAJ_ExamInfo oeiJAAJ_ExamInfo = ScoreData.GetCurrentExamInfo();
            if (oeiJAAJ_ExamInfo != null)
            {
                oeiJAAJ_ExamineeInfo = ScoreData.GetExamineeInfoByIDNum(txtIDNum.Text.Trim(), oeiJAAJ_ExamInfo.nvcBatchNO);
                if (oeiJAAJ_ExamineeInfo == null)
                {
                    MessageBox.Show("不存在该考生信息", "提示");
                    return;
                }
            }
            #endregion

            #region 调出对应考试科目的试题显示在终端界面上
            oepiExamProceInfo = ScoreData.GetExamProceInfoByExamineeID(oeiJAAJ_ExamineeInfo.iExamineeID);
            if (oepiExamProceInfo != null)
            {
                int iSubjectItemID = oepiExamProceInfo.iSubjectItemID;
                //下面代码可以根据科目子项ID调出对应的子项对应的试题.....
            }

            #endregion

            #region 修改设备状态为忙碌状态
            EnumSubmitResult oResult = ScoreData.UpdateDeviceStatus(1);
            #endregion
        }
Пример #2
0
        /// <summary>
        /// 根据考生ID获取考试过程实体
        /// </summary>
        /// <param name="iExamineeID">考生ID,非考生号</param>
        /// <returns>考试过程实体,JAAJ_ExamProceInfo</returns>
        public static JAAJ_ExamProceInfo GetExamProceInfoByExamineeID(int iExamineeID)
        {
            string strIP = GetLocalIP();
            //string strSqlString = "SELECT * FROM JAAJ_ExamProcess WHERE iExamineeID=" + iExamineeID + " AND iSubjectItemID IN (SELECT iSubjectItemID FROM JAAJ_SubjectItems WHERE iDeviceID=(SELECT iDeviceTypeID FROM JAAJ_Devices WHERE nvcIP='" + strIP + "'))";
            string             strSqlString = "SELECT * FROM JAAJ_ExamProcess WHERE iExamineeID={iExamineeID.ToString()} AND iDeviceID IN (select iDeviceID from JAAJ_Devices where nvcIP = '{strIP}')";
            SqlDatabase        odbDataBase  = new SqlDatabase(connectionString);
            DbCommand          odbCommand   = odbDataBase.GetSqlStringCommand(strSqlString);
            JAAJ_ExamProceInfo oInfo        = null;

            try
            {
                using (IDataReader reader = odbDataBase.ExecuteReader(odbCommand))
                {
                    if (reader.Read())
                    {
                        oInfo = new JAAJ_ExamProceInfo();
                        ModelHelper.LoadInfoData(oInfo, reader);
                    }
                }
            }
            catch (Exception oeException)
            {
                throw new Exception(oeException.Message, oeException);
            }
            return(oInfo);
        }
Пример #3
0
        private void CanExam(IAsyncResult result)
        {
            AsyncResult ar = (AsyncResult)result;
            MyDelegate  md = (MyDelegate)ar.AsyncDelegate;
            IDCard      IC = md.EndInvoke(result);

            if (IC == null)
            {
                Messenger.Default.Send <string>("          读卡器未连接", "ShowTip");
                return;
            }
            Name    = IC.Name;
            Sex     = IC.Sex;
            Nation  = IC.Nation;
            Address = IC.Address;
            IDCode  = IC.IDCode;

            #region 验证考试是否应该参与考试
            try
            {
                JAAJ_ExamineeInfo  oeiJAAJ_ExamineeInfo   = null;
                JAAJ_ExamInfo      oeiJAAJ_ExamInfo       = ScoreData.GetCurrentExamInfo();
                JAAJ_ExamProceInfo oepiJAAJ_ExamProceInfo = null;
                if (oeiJAAJ_ExamInfo != null)
                {
                    oeiJAAJ_ExamineeInfo = ScoreData.GetExamineeInfoByIDNum(IDCode, oeiJAAJ_ExamInfo.nvcBatchNO);
                    if (oeiJAAJ_ExamineeInfo != null)
                    {
                        ExamineeID = oeiJAAJ_ExamineeInfo.nvcExamineeGUID;
                        CommonHelper.examineeInfo = oeiJAAJ_ExamineeInfo;
                        oepiJAAJ_ExamProceInfo    = ScoreData.GetExamProceInfoByExamineeID(oeiJAAJ_ExamineeInfo.iExamineeID);

                        if (oepiJAAJ_ExamProceInfo != null)
                        {
                            Messenger.Default.Send <string>("", "GoMainView");
                            return;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //LogImpl.Error(string.Format("{0}{2}{1}", ex.StackTrace, ex.Message, System.Environment.NewLine));
            }
            Messenger.Default.Send <string>("        未安排在此考试\n     请联系考务人员解决", "ShowWarning");
            #endregion
        }
Пример #4
0
        ///	<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);
        }
Пример #5
0
        /// <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("分值提交失败", "提示");
                        }
                    }
                }
            }
        }