Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }

                // QueryString id stands for EXAM_RESULT_ID
                string strId = Request.QueryString.Get("id");
                if (!string.IsNullOrEmpty(strId))
                {
                    FillHeading(strId);
                }
            }

            string strJudgeData = hfJudgeData.Value;

            if (!string.IsNullOrEmpty(strJudgeData))
            {
                string                   strExamResultId = Request.QueryString.Get("id");
                string[]                 strItmes        = strJudgeData.Split('$');
                string[]                 strJudges       = new string[3];
                ExamResultBLL            bll             = new ExamResultBLL();
                ExamResultAnswer         answer          = null;
                IList <ExamResultAnswer> answers         = new List <ExamResultAnswer>();
                decimal                  judgeScore      = 0M;
                foreach (string item in strItmes)
                {
                    strJudges            = item.Split('|');
                    answer               = new ExamResultAnswer();
                    answer.ExamResultId  = int.Parse(strExamResultId);
                    answer.PaperItemId   = int.Parse(strJudges[0]);
                    answer.JudgeStatusId = int.Parse(strJudges[1]);
                    answer.JudgeScore    = decimal.Parse(strJudges[2]);
                    answer.JudgeRemark   = strJudges[3];

                    answers.Add(answer);

                    judgeScore += answer.JudgeScore;
                }

                string   strCause  = Server.UrlDecode(HiddenFieldUpdateCause.Value);
                string[] strCauses = strCause.Split('|');

                string  strResultCause = strCauses[0];
                string  strRemark      = strCauses[1];
                decimal oldScore       = decimal.Parse(ViewState["Score"].ToString());

                int examResultId = int.Parse(strExamResultId);
                bll.UpdateExamResultAnswers(examResultId, answers, strResultCause, strRemark, oldScore, RailExamWebApp.Common.Class.PrjPub.CurrentLoginUser.EmployeeName);

                bll.UpdateJudgeId(examResultId, RailExamWebApp.Common.Class.PrjPub.CurrentLoginUser.EmployeeID);
                lblScore.Text  = judgeScore.ToString();
                lblScore.Text += "分";
            }
        }