/// <summary>
 /// Обработчик сохранения оценок
 /// </summary>
 /// <param name="sender">Кнопка "Сохранить оценки"</param>
 /// <param name="e"></param>
 private void btSave_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(this, "Сохранить список оценок?", "Вступительные испытания", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         logger.Info($"Пользователь {activeEmployee.Fullname.Trim()} выполняет сохранение оценок абитуриентов.");
         // Сохраняем оценки абитуриентов
         foreach (DataGridViewRow row in EnrolleeGrid.Rows)
         {
             var assessment = assessmentService.GetAssessment(Int32.Parse(row.Cells[0].Value.ToString()));
             assessment.Estimation = Int32.Parse(row.Cells[4].Value.ToString());
             assessmentService.UpdateAssessment(assessment);
         }
     }
 }
Exemple #2
0
        /// <summary>
        /// 班级考评列表
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="pageIndex"></param>
        public void AssessmentList(int userID)
        {
            Assessment _assessment = new Assessment();

            _assessment.EmployeeID = userID;
            IList <Assessment> _assessmentList = _assessmentService.GetAssessment(_assessment);

            _result.Code = 0;
            _result.Data = _assessmentList;

            string _jsonString = JsonConvert.SerializeObject(_result, Formatting.Indented);

            RenderText(_jsonString);
            CancelLayout();
        }
        public void PostAssessment(int employeeID, int stID, string judgment)
        {
            int    _code    = 0;
            string _message = "考评录入失败";

            if (!string.IsNullOrEmpty(judgment))
            {
                Employee _employee = _employeeService.GetBaseEmployeeByID(employeeID);

                if (_employee != null)
                {
                    Assessment _assessment = new Assessment();
                    _assessment.EmployeeID = employeeID;
                    _assessment.STID       = stID;
                    IList <Assessment> _assessmentList = _assessmentService.GetAssessment(_assessment);
                    if (_assessmentList.Count > 0)
                    {
                        _assessment          = _assessmentList[0];
                        _assessment.TrueName = _employee.TrueName;
                        _assessment.Judgment = judgment;

                        _code    = _assessmentService.UpdateAssessment(_assessment);
                        _message = "修改考评记录成功!";
                    }
                    else
                    {
                        _assessment.TrueName = _employee.TrueName;
                        _assessment.Judgment = judgment;
                        _code    = _assessmentService.InsertAssessment(_assessment);
                        _message = "录入考评记录成功!";
                    }
                }
                else
                {
                    _code    = -1;
                    _message = "对不起,用户不存在!";
                }
            }
            else
            {
                _message = "对不起,评语不能为空!";
            }
            RenderText("{\"code\":\"" + _code + "\",\"message\":\"" + _message + "\"}");

            CancelLayout();
        }