Esempio n. 1
0
        /**********************************************************/

        public string createdOadrCreatedEvent(CreatedEventHelper createdEventHelper, string venID, int responseCode = 200, string responseDescription = "OK")
        {
            request = new oadrCreatedEventType();

            request.schemaVersion = "2.0b";

            request.eiCreatedEvent = new eiCreatedEvent();

            request.eiCreatedEvent.eiResponse = new EiResponseType();

            if (createdEventHelper.EventResponses.Count != 0)
            {
                request.eiCreatedEvent.eiResponse.requestID = "";
            }
            else
            {
                request.eiCreatedEvent.eiResponse.requestID = RandomHex.instance().generateRandomHex(10); //requestID;
            }
            request.eiCreatedEvent.eiResponse.responseCode        = responseCode.ToString();
            request.eiCreatedEvent.eiResponse.responseDescription = responseDescription;

            request.eiCreatedEvent.venID = venID;

            request.eiCreatedEvent.eventResponses = new eventResponsesEventResponse[createdEventHelper.EventResponses.Count];

            int index = 0;

            foreach (eventResponsesEventResponse eventResponse in createdEventHelper.EventResponses)
            {
                request.eiCreatedEvent.eventResponses[index] = eventResponse;
                index++;
            }

            return(serializeObject((object)request));
        }
Esempio n. 2
0
        /**********************************************************/

        public CreatedEvent createdEvent(CreatedEventHelper createdEventHelper, int responseCode = 200, string responseDescription = "OK")
        {
            CreatedEvent request = new CreatedEvent();

            string requestBody = request.createdOadrCreatedEvent(createdEventHelper, VENID, responseCode, responseDescription);

            if ((request.response = (oadrResponseType)postRequest(requestBody, "/EiEvent", request, true)) != null)
            {
                request.setEiResponse(request.response.eiResponse);
            }

            return(request);
        }