示例#1
0
        public async Task <bool> AddEvent(EventCreateVM model)
        {
            try
            {
                var conferenceEvent = new ConferenceEvent
                {
                    Id        = Guid.NewGuid(),
                    Name      = model.Name,
                    Date      = DateTime.Now,
                    Time      = model.Time,
                    Price     = model.Price,
                    ImageUrl  = model.ImageUrl,
                    OnlineUrl = model.OnlineUrl,
                    Location  = model.Location == null? null : new Location {
                        Address = model.Location.Address, City = model.Location.City, Country = model.Location.Country
                    }
                };
                await _eventService.AddEvent(conferenceEvent);

                return(true);
            }
            catch (RecordAlreadyExistException)
            {
                throw;
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public static ConferenceEvent ToDomainConferenceEvent(this Dblp.Data.Interfaces.Entities.ConferenceEvent incommingConferenceEvent)
        {
            var outgoingConferenceEvent = new ConferenceEvent();

            outgoingConferenceEvent.Key          = incommingConferenceEvent.EventKey;
            outgoingConferenceEvent.Title        = incommingConferenceEvent.Title;
            outgoingConferenceEvent.Publications = incommingConferenceEvent.Publications.ToDomainPublications();
            return(outgoingConferenceEvent);
        }
示例#3
0
 public static Task ProcessEvent(ConferenceEvent ev, UrlHelper url, HttpContextBase context)
 {
     Trace.WriteLine(string.Format("Conference-Conference {0}", ev.Id), "Events");
     if (ev.Status == "created")
     {
         context.Application.Set(string.Format("active-conf-{0}", Common.ConferenceNumber), ev.ConferenceId);
     }
     else
     {
         context.Application.Remove(string.Format("active-conf-{0}", Common.ConferenceNumber));
     }
     return(Task.Run(() => { }));
 }
示例#4
0
        public async Task <bool> AddEvent(ConferenceEvent model)
        {
            try
            {
                var response = await _containerResponse.Container.CreateItemAsync(model);

                _log.Info($"Added new location: {response.RequestCharge} RUs");
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
 private async Task ProcessConferenceEvent(ConferenceEvent ev, TinyIoCContainer container)
 {
     if (ev.Status == "created")
     {
         var conference = new Conference {Id = ev.ConferenceId};
         CurrentConference = conference;
         CurrentConferenceMember =
             await
                 conference.CreateMember(new Dictionary<string, object>
                 {
                     {"callId", CurrentCall.Id}
                 });
         await Call.Create(new Dictionary<string, object>
         {
             {"from", Context.Items["servicePhoneNumber"]},
             {"to", ContactPhoneNumber},
             {"recordingEnabled", true},
             {"callbackUrl", $"{Context.Items["baseUrl"]}/called-to-contact"}
         });
     }
     else
     {
         CurrentConference = null;
     }
 }