Пример #1
0
 public IActionResult Manage(Guid id) => _authenticationProvider.SomeIfAdministrator(User).Map(
     administrator =>
 {
     var talk = _talkService.GetById(id);
     return((IActionResult)base.View(
                new ManageTalkView(TalkView.FromDomain(talk),
                                   _placeService.ListFor(talk.City).Select(PlaceView.FromDomain).ToArray())
                ));
 }
     ).ValueOr(() => base.RedirectToAction("Administrator", "Authentication"));
Пример #2
0
        public IActionResult Manage(Guid id, EditTalkCommandWrapper wrapper)
        {
            var cmd  = wrapper.Command;
            var talk = _talkService.GetById(id);

            if (!ModelState.IsValid)
            {
                return(View(new ManageTalkView(TalkView.FromDomain(talk), cmd, _placeService.ListFor(talk.City).Select(PlaceView.FromDomain).ToArray())));
            }

            throw new NotImplementedException();
            //_talkService.MakeDraft(
            //	speakerId, cmd.CityId.Value, cmd.SpeakerName,
            //	cmd.SpeakerPhoto.SomeNotNull().ValueOr(() => new byte[0]),
            //	cmd.SpeakerAbout, cmd.SpeakerEmail, cmd.SpeakerFacebook.SomeNotNull(), cmd.SpeakerPhone.SomeNotNull(),
            //	cmd.TalkStartsAt.Value, cmd.TalkName, cmd.TalkComment, cmd.TalkShortInfo, cmd.TalkFullInfo
            //);
            //return View("SpeakerThankYou", new MakeDraftView(speakerId, cmd, _cityService.ListAll()));
        }