public ActionResult DeleteGuestConfirmed(int id, string returnUrl) { GuestParticipant participant = db.GuestParticipants.Find(id); db.GuestParticipants.Remove(participant); db.SaveChanges(); return(Redirect(returnUrl)); }
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)); }
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)); }
public ActionResult DeleteGuest(int id) { GuestParticipant participant = db.GuestParticipants.Find(id); return(View(participant)); }