Ejemplo n.º 1
0
        public async Task <IActionResult> Create(
            CreateAttendeeViewModel attendeeViewModel)
        {
            IActionResult actionResult = null;

            if (this.ModelState.IsValid)
            {
                var selectedInstanceID = this.InstanceSelector.InstanceID;

                var attendee = new Attendee();

                attendee.InstanceID   = selectedInstanceID;
                attendee.ModifiedDate = attendee.CreatedDate = DateTime.UtcNow;
                attendee.Deleted      = false;
                attendee.UserNumber   = DataUtils.GenerateNumber();
                attendee.ExternalID   = attendeeViewModel == null
                    ? string.Empty
                    : attendeeViewModel.ExternalID;

                this.DatabaseContext.Add(attendee);

                await this.DatabaseContext.SaveChangesAsync();

                actionResult = this.RedirectToAction(nameof(this.Index));
            }
            else
            {
                actionResult = this.View(attendeeViewModel);
            }

            return(actionResult);
        }
Ejemplo n.º 2
0
        public CreateAttendeeDialog(CreateAttendeeViewModel viewModel)
        {
            _viewModel            = viewModel;
            _viewModel.ThingGood += RespondToAttendeeGood;

            DataContext = _viewModel;

            InitializeComponent();
        }
Ejemplo n.º 3
0
        public ICreateNewThings <IAttendee> CreateDialog()
        {
            var viewModel = new CreateAttendeeViewModel();

            return(new CreateAttendeeDialog(viewModel));
        }
Ejemplo n.º 4
0
        public IActionResult Create()
        {
            var viewModel = new CreateAttendeeViewModel();

            return(this.View(viewModel));
        }