Esempio n. 1
0
        public IActionResult AddTechSkill(AddTechSkillViewModel model)
        {
            if (ModelState.IsValid)
            {
                EmployeeTechnicalSkill newTechSkill = new EmployeeTechnicalSkill
                {
                    EmployeeId = model.EmployeeId,
                    Name       = model.Name,
                    Level      = model.Level,
                    Notes      = model.Notes,
                    LevelId    = model.LevelId,
                    SkillId    = model.SkillId
                };
                _employeeRepository.AddEmpTechSkill(newTechSkill);

                var successMessage = "TechSkill Info Created Successfully. Name: " + newTechSkill.EmployeeId;
                TempData["successAlert"] = successMessage;
                // return View(successMessage, "");
                return(PartialView("_PartialMessage"));
            }
            return(View());
        }
 public EmployeeTechnicalSkill AddEmpTechSkill(EmployeeTechnicalSkill technicalSkill)
 {
     _context.EmployeeTechnicalSkills.Add(technicalSkill);
     _context.SaveChanges();
     return(technicalSkill);
 }