Ejemplo n.º 1
0
        public ActionResult Add(Guid presentationid)
        {
            var presentation      = presentations.FindOne(p => p.Id == presentationid);
            var attendeeFormModel = new AttendeeFormModel(presentation.Id, presentation.Title);

            return(View(attendeeFormModel));
        }
        public ActionResult Add(Guid presentationid)
        {
            var presentation = presentations.FindOne(p => p.Id == presentationid);
            var attendeeFormModel = new AttendeeFormModel(presentation.Id, presentation.Title);

            return View(attendeeFormModel);
        }
Ejemplo n.º 3
0
        public ActionResult Add(AttendeeFormModel attendeeFormModel)
        {
            if (ModelState.IsValid)
            {
                var presentation = presentations.FindOne(p => p.Id == attendeeFormModel.presentationId);
                var attendee     = new Attendee
                {
                    Name     = attendeeFormModel.Name,
                    Email    = attendeeFormModel.Email,
                    Password = attendeeFormModel.Password,
                    Speaker  = attendeeFormModel.Speaker
                };

                presentation.AddAttendee(attendee);
                presentations.Update(presentation);

                return(RedirectToAction("Details", "Presentations", new { id = presentation.Id }));
            }

            return(View(attendeeFormModel));
        }
        public ActionResult Add(AttendeeFormModel attendeeFormModel)
        {
            if (ModelState.IsValid)
            {
                var presentation = presentations.FindOne(p => p.Id == attendeeFormModel.presentationId);
                var attendee = new Attendee
                                   {
                                       Name = attendeeFormModel.Name,
                                       Email = attendeeFormModel.Email,
                                       Password = attendeeFormModel.Password,
                                       Speaker = attendeeFormModel.Speaker
                                   };

                presentation.AddAttendee(attendee);
                presentations.Update(presentation);

                return RedirectToAction("Details", "Presentations", new { id = presentation.Id });
            }

            return View(attendeeFormModel);
        }