Ejemplo n.º 1
0
        private void SendItem(SPItemEventProperties properties)
        {
            GetKeyAndUrl(properties);

            ServicePointManager.ServerCertificateValidationCallback +=
                delegate(
                    object sender,
                    X509Certificate certificate,
                    X509Chain chain,
                    SslPolicyErrors sslPolicyErrors)
            {
                return(true);
            };
            if (url != "")
            {
                try
                {
                    UplandPlatformAPI.IntegrationAPI api = new UplandPlatformAPI.IntegrationAPI();
                    api.Url = url;
                    var ret = api.PostItemSimple(key, properties.ListItemId.ToString());
                    InsertPlatformIntegrationLogIfNotSuccess(properties, ret);
                }
                catch (Exception ex)
                {
                    InsertPlatformIntegrationLog(properties, ex.Message);
                    Trace.WriteLine(ex.ToString());
                }
            }
        }
Ejemplo n.º 2
0
        public override void ItemDeleting(SPItemEventProperties properties)
        {
            GetKeyAndUrl(properties);

            if (url != "")
            {
                try
                {
                    UplandPlatformAPI.IntegrationAPI api = new UplandPlatformAPI.IntegrationAPI();
                    api.Url = url;
                    var ret = api.DeleteItem(key, properties.ListItemId.ToString());
                    InsertPlatformIntegrationLogIfNotSuccess(properties, ret);
                }
                catch (Exception ex)
                {
                    InsertPlatformIntegrationLog(properties, ex.Message);
                    Trace.WriteLine(ex.ToString());
                }
            }
        }