Esempio n. 1
0
        /// <summary>
        /// Sends the public data and impact statistics to the Rock server.
        /// </summary>
        /// <param name="rockInstanceId"></param>
        /// <param name="version"></param>
        /// <param name="ipAddress"></param>
        /// <param name="publicUrl"></param>
        /// <param name="organizationName"></param>
        /// <param name="organizationAddress"></param>
        /// <param name="numberOfActiveRecords"></param>
        private void SendToSpark(Guid rockInstanceId, string version, string ipAddress, string publicUrl, string organizationName, ImpactLocation organizationLocation, int numberOfActiveRecords)
        {
            ImpactStatistic impactStatistic = new ImpactStatistic()
            {
                RockInstanceId        = rockInstanceId,
                Version               = version,
                IpAddress             = ipAddress,
                PublicUrl             = publicUrl,
                OrganizationName      = organizationName,
                OrganizationLocation  = organizationLocation,
                NumberOfActiveRecords = numberOfActiveRecords
            };

            var client  = new RestClient("http://www.rockrms.com/api/impacts/save");
            var request = new RestRequest(Method.POST);

            request.RequestFormat = DataFormat.Json;
            request.AddBody(impactStatistic);
            var response = client.Execute(request);
        }
Esempio n. 2
0
        /// <summary>
        /// Sends the public data and impact statistics to the Rock server.
        /// </summary>
        /// <param name="rockInstanceId"></param>
        /// <param name="version"></param>
        /// <param name="ipAddress"></param>
        /// <param name="publicUrl"></param>
        /// <param name="organizationName"></param>
        /// <param name="organizationAddress"></param>
        /// <param name="numberOfActiveRecords"></param>
        private void SendToSpark( Guid rockInstanceId, string version, string ipAddress, string publicUrl, string organizationName, ImpactLocation organizationLocation, int numberOfActiveRecords )
        {
            ImpactStatistic impactStatistic = new ImpactStatistic()
            {
                RockInstanceId = rockInstanceId,
                Version = version,
                IpAddress = ipAddress,
                PublicUrl = publicUrl,
                OrganizationName = organizationName,
                OrganizationLocation = organizationLocation,
                NumberOfActiveRecords = numberOfActiveRecords
            };

            var client = new RestClient( "http://www.rockrms.com/api/impacts/save" );
            var request = new RestRequest( Method.POST );
            request.RequestFormat = DataFormat.Json;
            request.AddBody( impactStatistic );
            var response = client.Execute( request );
        }