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); }
public CreateAttendeeDialog(CreateAttendeeViewModel viewModel) { _viewModel = viewModel; _viewModel.ThingGood += RespondToAttendeeGood; DataContext = _viewModel; InitializeComponent(); }
public ICreateNewThings <IAttendee> CreateDialog() { var viewModel = new CreateAttendeeViewModel(); return(new CreateAttendeeDialog(viewModel)); }
public IActionResult Create() { var viewModel = new CreateAttendeeViewModel(); return(this.View(viewModel)); }