Пример #1
0
        public Dictionary <string, string> CreateEvent(EventModel requestEventData)
        {
            Dictionary <string, string> response;

            try
            {
                response = _events.AddEvent(requestEventData.Name, requestEventData.Description,
                                            requestEventData.Venue, requestEventData.PosterImagePath, requestEventData.StartTime,
                                            requestEventData.EndTime, requestEventData.EventDate, requestEventData.AttendeesDataTable,
                                            requestEventData.CreatedBy);
                if (response == null)
                {
                    return(null);
                }
            }


            catch (Exception ex)
            {
                Debug.Print(ex.Message);
                return(null);
            }


            return(response);
        }
Пример #2
0
 private async Task RegisterEventWithEventsComponent(Instance instance)
 {
     if (_appSettings.RegisterEventsWithEventsComponent)
     {
         try
         {
             if (!string.IsNullOrWhiteSpace(instance.Process.CurrentTask?.ElementId))
             {
                 await _eventsService.AddEvent($"app.instance.process.movedTo.{instance.Process.CurrentTask.ElementId}", instance);
             }
             else if (instance.Process.EndEvent != null)
             {
                 await _eventsService.AddEvent("app.instance.process.completed", instance);
             }
         }
         catch (Exception exception)
         {
             _logger.LogWarning(exception, "Exception when sending event with the Events component.");
         }
     }
 }
Пример #3
0
 private async Task RegisterInstanceCreatedEvent(Instance instance)
 {
     if (_appSettings.RegisterEventsWithEventsComponent)
     {
         try
         {
             await _eventsService.AddEvent("app.instance.created", instance);
         }
         catch (Exception exception)
         {
             _logger.LogWarning(exception, "Exception when sending event with the Events component.");
         }
     }
 }
Пример #4
0
        public HttpResponseMessage CreateEvent(EventModel requestEventData)
        {
            try
            {
                var response = _events.AddEvent(requestEventData.Name, requestEventData.Description, requestEventData.Venue, requestEventData.PosterImagePath, requestEventData.StartTime, requestEventData.EndTime, requestEventData.EventDate, requestEventData.AttendeesDataTable);
                if (!response)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, "Check the Data"));
                }
            }


            catch (Exception ex)
            {
                Debug.Print(ex.Message);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Internal Server Error"));
            }


            return(Request.CreateResponse(HttpStatusCode.Created, new { Message = "Successfully Created!" }));
        }