예제 #1
0
 public ActionResult CreateOrUpdateSkill(DogSkill dogSkill)
 {
     _dogSkillRepo.Update(dogSkill);
     return RedirectToAction("GetSkill", "Skills");
 }
예제 #2
0
 public ActionResult CreateOrUpdateSkill(DogSkill dogSkill)
 {
     throw new NotImplementedException();
 }
예제 #3
0
        public ActionResult CreateOrUpdateDogSkill(DogSkill dogSkill)
        {

            var user = _userRepo.Where(u => u.Email == this.HttpContext.User.Identity.Name).FirstOrDefault();

            if (user.IsUserAdminOrTrainer())
            {

                if (dogSkill.DogSkilID == 0)
                {
                    _dogSkillRepo.Insert(dogSkill);
                }
                else
                {
                    _dogSkillRepo.Update(dogSkill);
                }
                return RedirectToAction("ReadDog", new { id = dogSkill.DogProfileID });
            }

            return RedirectToAction("Error403", "Error");
        }