partial void DeleteTrackerTableListItem(TrackerTableListItem instance);
partial void UpdateTrackerTableListItem(TrackerTableListItem instance);
/// <summary> /// Handle a failure of the OP Summary update. /// </summary> /// <param name="item">TrackerTableListItem</param> private static void HandleFailure(TrackerTableListItem item) { if (_failures.Where(x => x.EntryType == 0 && x.ItemId == item.BlogOrTopicId).Count() == 0) { _failures.Add(new FailureCount() { Count = 1, ItemId = item.BlogOrTopicId, EntryType = item.EntryType }); } else { int j = _failures.IndexOf(_failures.Where(x => x.EntryType == 0 && x.ItemId == item.BlogOrTopicId).Single()); if (_failures[j].Count != 10) { _failures[j].Count++; } else { //Failed too many times in this session, so we will simply give up trying to update this record. item.FirstPostSummary = item.Title + "<!-- BPF -->"; //Giving it some meaningful value, suffixing with a mark of failure. item.IsPstSummaryUpdateRequired = false; _failures.RemoveAt(j); } } }
partial void InsertTrackerTableListItem(TrackerTableListItem instance);
public TrackerDo GetTwitterConversations(int page, string gameAbbrev) { if (gameAbbrev == null) throw new ArgumentNullException("gameAbbrev"); gameAbbrev = gameAbbrev.ToUpper(); TrackerDo tracker = new TrackerDo(); var db = new TwitterDataContext(DbConnectionString.Value); List<TwitterConversation> conversations = new List<TwitterConversation>(); int itemCount = 0; if (gameAbbrev == "ALL") { var query = (from c in db.TwitterConversations orderby c.LastDevResponseDate descending select c); itemCount = query.Count(); conversations = query.Skip((page - 1) * 50).Take(50).ToList(); } else { var query = (from c in db.TwitterConversations where c.BlizzArea.Game.GameAbbreviation == gameAbbrev orderby c.LastDevResponseDate descending select c); itemCount = query.Count(); conversations = query.Skip((page - 1) * 50).Take(50).ToList(); } List<TrackerTableListItem> trackerListItems = new List<TrackerTableListItem>(); foreach (var conversation in conversations) { TrackerTableListItem item = new TrackerTableListItem { BlogOrTopicId = conversation.Id, BoardNumber = 0, EntryNumber = 0, EntryType = 2, Game = conversation.BlizzArea.Game.GameAbbreviation, Id = 0, Lang = conversation.BlizzArea.Language.LanguageAbbreviation, LastBlue = conversation.LastBlueResponder, //LastPoster = "", NoReplies = conversation.Tweets.Count, //OpSummary = conversation.Tweets[0].TweetContentNonHtml, Region = conversation.BlizzArea.Region.RegionAbbreviation, SubForum = "Twitter", ThreadAuthor = conversation.Tweets[0].TwitterUserName, TimeOfLatestPost = conversation.LastDevResponseDate, Title = conversation.TwitterConvTitle }; trackerListItems.Add(item); } tracker.TrackerItems = GetItemsDomainObjects(trackerListItems); tracker.PageTitle = "Twitter"; tracker.TotalItems = itemCount; return tracker; }