Beispiel #1
0
        public ActionResult DeleteDog(int id, FormCollection formCollection)
        {
            var repo = RepoResolver.GetRepository <DogProfile>();

            repo.Delete(id);
            return(RedirectToAction("GetDogs"));
        }
Beispiel #2
0
        public ActionResult GetNote(int id)
        {
            var repo = RepoResolver.GetRepository <DogNote>();
            var note = repo.GetById(id);

            return(PartialView(note));
        }
Beispiel #3
0
        public ActionResult GetDogs()
        {
            var repo = RepoResolver.GetRepository <DogProfile>("K9");
            var dogs = repo.GetAll();

            return(View(dogs));
        }
Beispiel #4
0
        public ActionResult DeleteDog(int id)
        {
            var repo = RepoResolver.GetRepository <DogProfile>();
            var dog  = repo.GetById(id);

            return(View(dog));
        }
Beispiel #5
0
        public ActionResult DeleteSkill(int id)
        {
            IRepository <DogSkill> repo = RepoResolver.GetRepository <DogSkill>();

            repo.Delete(id);
            return(RedirectToAction("Index", "Skills"));
        }
Beispiel #6
0
        public ActionResult GetDogs()
        {
            var repo = RepoResolver.GetRepository <DogProfile>();
            var dogs = repo.GetAll();

            throw new NotImplementedException();
        }
Beispiel #7
0
        public ActionResult GetSkill(int id)
        {
            IRepository <DogSkill> repo = RepoResolver.GetRepository <DogSkill>();

            repo.GetById(id);
            return(View(id));
        }
Beispiel #8
0
        public ActionResult CreateOrUpdateSkill(DogSkill dogSkill)
        {
            IRepository <DogSkill> repo = RepoResolver.GetRepository <DogSkill>();

            repo.Update(dogSkill);
            return(RedirectToAction("GetSkill", "Skills"));
        }
Beispiel #9
0
        //
        // GET: /Skills/

        public virtual ActionResult Index()
        {
            IRepository <DogSkill> repo   = RepoResolver.GetRepository <DogSkill>();
            IQueryable <DogSkill>  skills = repo.GetAll();

            return(View(skills));
        }
Beispiel #10
0
        public ActionResult CreateOrUpdateDog(DogProfile dogProfile)
        {
            var repo = RepoResolver.GetRepository <DogProfile>();

            if (dogProfile.ProfileID == 0)
            {
                repo.Insert(dogProfile);
            }
            else
            {
                repo.Update(dogProfile);
            }

            return(View(dogProfile));
        }
Beispiel #11
0
 public DogController()
 {
     _dogRepo = RepoResolver.GetRepository <DogProfile>();
 }