예제 #1
0
        public IActionResult Save(RecommendationItem model)
        {
            var UserId = int.Parse(HttpContext.Session.GetString("UserId"));

            if (ModelState.IsValid)
            {
                var item = new Recommendation
                {
                    Id           = model.Id,
                    Employee     = _Services.GetAccountById(model.EmployeeId),
                    Comment      = model.Recommendation,
                    CreatedBy    = model.CreatedBy,
                    CreationDate = model.CreationDate,
                };
                _Services.Save(item, UserId);
            }
            return(RedirectToAction("Index"));
        }