コード例 #1
0
        public ActionResult DeleteGuestConfirmed(int id, string returnUrl)
        {
            GuestParticipant participant = db.GuestParticipants.Find(id);

            db.GuestParticipants.Remove(participant);
            db.SaveChanges();
            return(Redirect(returnUrl));
        }
コード例 #2
0
        public ActionResult GuestRegister(int registerEntryId)
        {
            var r = db.RegisterEntries.Find(registerEntryId);

            ViewBag.registerEntry = r;

            GuestParticipant p = new GuestParticipant
            {
                RegisterEntryId = r.Id,
                IsChristian     = false,
            };

            return(View(p));
        }
コード例 #3
0
        public ActionResult GuestRegister(GuestParticipant participant)
        {
            if (ModelState.IsValid)
            {
                if (String.IsNullOrEmpty(participant.Name) || String.IsNullOrEmpty(participant.Email) || String.IsNullOrEmpty(participant.Phone))
                {
                    ModelState.AddModelError("", "Failed: Name, Email and Phone are neccessary for registration, please fill them in");
                    ViewBag.registerEntry = db.RegisterEntries.Find(participant.RegisterEntryId);
                    return(View(participant));
                }
                db.GuestParticipants.Add(participant);
                db.SaveChanges();
                return(RedirectToAction("GuestRegisterSuccess", new { registerEntryId = participant.RegisterEntryId }));
            }

            ViewBag.registerEntry = db.RegisterEntries.Find(participant.RegisterEntryId);
            return(View(participant));
        }
コード例 #4
0
        public ActionResult DeleteGuest(int id)
        {
            GuestParticipant participant = db.GuestParticipants.Find(id);

            return(View(participant));
        }