예제 #1
0
 public ActionResult RegisterGuest(Registration registration)
 {
     if (ModelState.IsValid)
     {
         _registrationRepository.Add(registration);
         _registrationRepository.Save();
         Response.Cookies.Append("registered"+registration.MeetingId, "true");
     }
     return RedirectToAction("Detail", registration.MeetingId);
 }
예제 #2
0
 public async Task<ActionResult> Register(int meetingId)
 {
     var user = await _userManager.FindByIdAsync(User.GetUserId());
     var registration = new Registration
     {
         MeetingId = meetingId,
         UserId = user.Id,
         Name = user.Name,
         Email = user.Email
     };
     _registrationRepository.Add(registration);
     _registrationRepository.Save();
     return RedirectToAction("Detail", new {id = meetingId});
 }