Ejemplo n.º 1
0
 public ActionResult CreateOrUpdateSkill(DogSkill dogSkill)
 {
     _dogSkillRepo.Update(dogSkill);
     return RedirectToAction("GetSkill", "Skills");
 }
Ejemplo n.º 2
0
 public ActionResult CreateOrUpdateSkill(DogSkill dogSkill)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 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");
        }