public async Task <ActionResult <GoogleMapsApiKeyApiResponse> > GoogleMapsApiKey(Guid?venueId) { if (TryGetMemberId() == null) { VersionedServiceResult <Venue> venue = venueId != null ? await _venueService.GetVenue(null, null, venueId.Value) : new VersionedServiceResult <Venue>(0, null); if (venue.Value == null) { throw new OdkNotAuthorizedException(); } } return(await HandleVersionedRequest( _settingsService.GetSiteSettings, _mapper.Map <GoogleMapsApiKeyApiResponse>)); }
public async Task <IActionResult> GetVenuesById(long Id) { try { var response = await _venueService.GetVenue(Id); if (response.ResponseCode != ResponseCode.Ok) { return(Ok(WebApiResponses <VenueModel> .ErrorOccured(response.Message))); } return(Ok(WebApiResponses <VenueModel> .Successful(response.ResponseData))); } catch (Exception ex) { Log.Error(ex); return(Ok(WebApiResponses <VenueModel> .ErrorOccured(ex.Message))); } }
public IActionResult Add(AddSessionViewModel model) { var talk = talkService.GetTalk(model.TalkId); var venue = venueService.GetVenue(model.VenueId); var session = new Session { Talk = talk, Start = model.StartDate.AddHours(model.StartTime), Venue = venue, TalkType = talkService.GetTalkType(model.TalkTypeId), Status = SessionStatus.Open }; sessionService.AddSession(session); return(View("Index", new SessionListViewModel { SessionList = sessionService.GetSessions().ToList() })); }
public async Task <ActionResult <VenueApiResponse> > Get(Guid id) { return(await HandleVersionedRequest( version => _venueService.GetVenue(version, TryGetMemberId(), id), _mapper.Map <VenueApiResponse>)); }