Пример #1
0
 public ActionResult AddSkill(int id)
 {
     var categoryDetails = _categoryRepository.GetCategoryById(id);
     var skill = new SkillAddModel();
     if (categoryDetails != null)
     {
         skill.CategoryId = categoryDetails.CategoryId;
     }
     return View(skill);
 }
Пример #2
0
 public ActionResult AddSkill(SkillAddModel skillAddModel)
 {
     if (ModelState.IsValid)
     {
         var skill = new Skill
                       {
                           CategoryId = skillAddModel.CategoryId,
                           SkillName = skillAddModel.SkillName
                       };
         _skillRepository.AddSkill(skill);
     }
     return RedirectToAction("Index");
 }