Example #1
0
        private static void sendTrackback(TrackbackOutbound trackback)
        {
            WebClient wc            = new WebClient();
            string    pageText      = wc.DownloadString(trackback.TargetUrl);
            string    trackBackItem = getTrackBackText(pageText, trackback.TargetUrl, trackback.PostUrl);

            if (trackBackItem != null)
            {
                if (!trackBackItem.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase))
                {
                    trackBackItem = "http://" + trackBackItem;
                }

                sendPing(
                    trackBackItem,
                    string.Format(
                        "title={0}&url={1}&blog_name={2}&excerpt={3}",
                        HttpUtility.HtmlEncode(trackback.PostTitle),
                        HttpUtility.HtmlEncode(trackback.PostUrl),
                        HttpUtility.HtmlEncode(trackback.PostBlogTitle),
                        HttpUtility.HtmlEncode(trackback.PostBody)
                        )
                    );
            }
        }
        public void Save(TrackbackOutbound trackback)
        {
            using (TransactionScope transaction = new TransactionScope())
            {
                oxite_TrackbackOutbound tb = (
                    from t in context.oxite_TrackbackOutbounds
                    where t.TrackbackOutboundID == trackback.ID
                    select t
                    ).First();

                tb.SentDate            = trackback.Sent;
                tb.RemainingRetryCount = (byte)trackback.RemainingRetryCount;
                tb.IsSending           = false;
                tb.LastAttemptDate     = DateTime.Now.ToUniversalTime();

                context.SubmitChanges();

                transaction.Complete();
            }
        }
 public void Save(TrackbackOutbound trackback)
 {
     throw new NotImplementedException();
 }
 public void Save(TrackbackOutbound trackback)
 {
     repository.Save(trackback);
 }