Exemplo n.º 1
0
 public ActionResult Index(string game, string lang, string sub1, string sub2)
 {
     ActionResult actionResult;
     try
     {
         TrackerDo tracker = this._trackerLogic.GetTracker(game, lang, "1", true, true, false);
         if (tracker.TrackerItems.Count == 0)
         {
             throw new HttpException(404, "Not found.");
         }
         Tracker tracker1 = new Tracker()
         {
             LanguageAbbrev = lang,
             RealItemCount = tracker.TotalItems,
             PageTitle = tracker.PageTitle,
             CurrentPage = tracker.CurrentPage,
             Sub1 = sub1,
             Sub2 = sub2
         };
         foreach (TrackerItemDo trackerItem in tracker.TrackerItems)
         {
             TrackerItem trackerItem1 = new TrackerItem()
             {
                 BlueReplyCount = trackerItem.NoReplies,
                 BoardNumber = trackerItem.SubForumBlizzId,
                 EntryType = (ItemType)trackerItem.EntryType,
                 Game = trackerItem.GameAbbrev.ToLower(),
                 Id = trackerItem.EntryId,
                 LastBlue = trackerItem.LastBluePoster,
                 OpSummaryRaw = trackerItem.OpSummary,
                 Region = trackerItem.RegionAbbrev.ToLower(),
                 SubForum = trackerItem.SubForumName,
                 ThreadAuthor = trackerItem.Author,
                 TimeOfLatestPost = trackerItem.LastUpdateTime,
                 Title = trackerItem.ThreadTitle,
                 Lang = trackerItem.LanguageAbbrev.ToLower()
             };
             tracker1.TrackerItems.Add(trackerItem1);
         }
         actionResult = base.View(tracker1);
     }
     catch (Exception exception1)
     {
         Exception exception = exception1;
         if (exception is ArgumentNullException || exception is ArgumentException)
         {
             throw new HttpException(404, "The page you are looking for could not be found.");
         }
         throw;
     }
     return actionResult;
 }
Exemplo n.º 2
0
 public static Tracker GetModel(TrackerDo trackerDo, string lang, string game)
 {
     Tracker tracker = new Tracker()
     {
         LanguageAbbrev = lang.ToLower(),
         RealItemCount = trackerDo.TotalItems,
         PageTitle = trackerDo.PageTitle,
         CurrentPage = trackerDo.CurrentPage,
         SecondaryTitle1 = trackerDo.SecondaryTitle1,
         SecondaryTitle2 = trackerDo.SecondaryTitle2,
         GameAbbrev = game.ToLower(),
         UserLanguageAbbrev = lang
     };
     Tracker tracker1 = tracker;
     foreach (TrackerItemDo trackerItem in trackerDo.TrackerItems)
     {
         TrackerItem trackerItem1 = new TrackerItem()
         {
             BlueReplyCount = trackerItem.NoReplies,
             BoardNumber = trackerItem.SubForumBlizzId,
             EntryType = (ItemType)trackerItem.EntryType,
             Game = trackerItem.GameAbbrev.ToLower(),
             Id = trackerItem.EntryId,
             LastBlue = trackerItem.LastBluePoster,
             OpSummaryRaw = trackerItem.OpSummary,
             Region = trackerItem.RegionAbbrev.ToLower(),
             SubForum = trackerItem.SubForumName,
             ThreadAuthor = trackerItem.Author,
             TimeOfLatestPost = trackerItem.LastUpdateTime,
             Title = trackerItem.ThreadTitle,
             Lang = trackerItem.LanguageAbbrev.ToLower()
         };
         tracker1.TrackerItems.Add(trackerItem1);
     }
     return tracker1;
 }