public IActionResult ViewKeyResultArea(int headerid)
        {
            var header = _EvaluationApproval.GetRatingHeaderById(headerid);
            var result = _EvaluationApproval.GetRatingKeySuccessAreasById(headerid)
                         .Select(a => new ApprovalKeyResultItemViewModel
            {
                Id = a.Id,
                SuccessIndicator = a.KeySuccessIndicator.RatingTable.Description,
                Rating           = _EvaluationApproval.SuccessRating(headerid, a.Id),
                Comment          = a.Comment,
                Score            = _EvaluationApproval.SuccessScore(headerid, a.Id).ToString(),
                Weight           = a.KeySuccessIndicator.Weight.ToString(),
            }).ToList();

            var kra = _EvaluationApproval.GetKeyResultAreaByHeaderId(headerid);

            var model = new ApprovalKeyResultAreaViewModel
            {
                Id            = header.Id,
                EmployeeName  = header.Ratee.LastName + ", " + header.Ratee.FirstName,
                RaterName     = header.Rater.LastName + ", " + header.Rater.FirstName,
                KeyResultArea = kra.Title + "-" + kra.Description,
                Weight        = kra.Weight.ToString(),
                Remarks       = string.Empty,
                TotalScore    = _EvaluationApproval.GetKeyResultAreaTotalScore(headerid).ToString(),
                Items         = result,
            };

            return(View(model));
        }
        public IActionResult PostKeyResultArea(ApprovalKeyResultAreaViewModel model)
        {
            var UserId = int.Parse(HttpContext.Session.GetString("UserId"));

            if (model.Action == "Approve")
            {
                _EvaluationApproval.Approved(model.Id, UserId, model.Remarks);
            }
            else
            {
                _EvaluationApproval.Disapproved(model.Id, UserId, model.Remarks);
            }

            return(RedirectToAction("Index"));
        }