コード例 #1
0
        // GET: Kids/Edit/5
        public ActionResult Edit(int id)
        {
            Kid kid = service.GetById(id);

            if (kid == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FundRaiserID = new SelectList(db.Fundraisers, "FundRaiserID", "Email", kid.FundRaiserID);
            return(View(kid));
        }
コード例 #2
0
        public ActionResult DeleteKid(int id)
        {
            Kid c = ks.GetById(id);

            ks.Delete(c);
            ks.Commit();
            return(RedirectToAction("Profil"));
        }
コード例 #3
0
        // GET: Wishes/Create/kidId
        public ActionResult Create(int id)
        {
            int kidId = id;

            //display the firstname in the view
            string KidFirstName = KidService.
                                  GetById(kidId).
                                  KidFistName;

            //initialise the wish with the kid id
            Wish wish = new Wish
            {
                KidID = kidId
            };

            ViewBag.KidFirstName = KidFirstName;
            return(View(wish));
        }