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()); } } }
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()); } } }