예제 #1
0
        public IActionResult Assign(int id)
        {
            var result = _Services.RecommendationByEmployeeId(id);
            var item   = new RecommendationItem();
            var aes    = _Services.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;

            if (result == null)
            {
                item.Id           = 0;
                item.EmployeeId   = id;
                item.EmployeeName = _Services.GetNameById(id);
            }
            else
            {
                item.Id             = result.Id;
                item.EmployeeId     = id;
                item.EmployeeName   = _Services.GetNameById(id);
                item.Recommendation = result.Comment;
                item.CreatedBy      = result.CreatedBy;
                item.CreationDate   = result.CreationDate;
            }
            item.IsWithActiveSeason = _Services.IsWithActiveSeason();
            item.ActiveSeason       = season;
            return(View(item));
        }