Exemplo n.º 1
0
        /// <summary>
        /// Get evaluation template for display.
        /// </summary>
        /// <param name="id">The identity of evaluation template.</param>
        /// <returns></returns>
        public EvaluationTemplateDisplayViewModel LoadTemplate(int id)
        {
            var result      = new EvaluationTemplateDisplayViewModel();
            var evaTemplate = _unitOfWork.GetRepository <EvaluationTemplate>().GetCache(x => x.Id == id).FirstOrDefault();

            if (evaTemplate != null)
            {
                result.Name          = evaTemplate.EvaluationTemplateName;
                result.Criteria      = _criteria.GetDetail(evaTemplate.CriteriaId.Value);
                result.LevelPoint    = _levelPoint.GetDetail(evaTemplate.LevelPointId.Value);
                result.Grade         = _grade.GetDetail(evaTemplate.GradeId.Value);
                result.MaxTotalScore = this.GetMaxTotalScore(result.LevelPoint.WeightingKey, result.LevelPoint.LevelPointItems.Count, result.Criteria);
            }
            return(result);
        }
Exemplo n.º 2
0
 public IActionResult GetDetail(int id)
 {
     return(Ok(_levelPoint.GetDetail(id)));
 }