Exemplo n.º 1
0
 public ActionResult RegisterGuest([Bind(Include = "GuestId,FirstName,LastName,Email,Preregistered,WonCheckInRaffle,ExtraRaffleEntry,WonExtraRaffleEntry")] EventGuest eventGuest)
 {
     Trace.WriteLine("POST /EventGuests/RegisterGuest eventGuest: " + eventGuest.ToString());
     ViewBag.Title     = "Register";
     ViewBag.Message   = EventGuestConstants.REGISTRATION_DEFAULT;
     ViewBag.EventName = Settings.Default.EventName;
     ViewBag.FailedCheckInPreregister = true;
     if (!ModelState.IsValid)
     {
         return(View(eventGuest));
     }
     if (!repository.AddEventGuestToDbContext(eventGuest))
     {
         String errorMessage = ViewBag.Message = EventGuestConstants.REGISTRATION_EXISTING_ERROR + eventGuest.Email;
         return(View(eventGuest));
     }
     if (eventGuest.Preregistered == false)
     {
         ViewBag.SuccessfulCheckIn = true;
     }
     else
     {
         ViewBag.SuccessfulPreregister = true;
     }
     ViewBag.FailedCheckInPreregister = null;
     return(View(new EventGuest {
     }));
 }
Exemplo n.º 2
0
 public ActionResult EditGuest([Bind(Include = "GuestId,FirstName,LastName,Email")] EventGuest eventGuest)
 {
     Trace.WriteLine("POST EventGuest/Edit eventGuest: " + eventGuest.ToString());
     ViewBag.Title   = "Edit Guest";
     ViewBag.Message = "Make edits to a registered event guest.";
     if (ModelState.IsValid)
     {
         repository.UpdateEventGuest(eventGuest);
         return(RedirectToAction("GuestListIndex"));
     }
     return(View(eventGuest));
 }