Esempio n. 1
0
        public ActionResult Index(int page = 1)
        {
            HtmlString paginationHtml;
            var        archivedApps = _logics.GetLatestApps(db, true, page, out paginationHtml, false);

            ViewBag.Title          = "Apps";
            ViewBag.Meta           = "Latest mobile apps, apps review, apple apps, android apps, " + ViewBag.Title;
            ViewBag.Keywords       = ViewBag.Meta;
            ViewBag.Apps           = archivedApps;
            ViewBag.paginationHtml = paginationHtml;
            ViewBag.breadcrumbs    = _logics.GetBredcrumbsBasedOnCurrentUrl();
            return(View("Index"));
        }
Esempio n. 2
0
        //               ViewBag.Title;
        //ViewBag.Meta = "Tags , Mobile apps, apps review, apple apps, android apps,reviews, app review site, " +
        //ViewBag.Title = "Mobile Applications Tags";

        public ActionResult GetTagDetail(string id, int page = 1)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return(HttpNotFound());
            }
            var tagname = Logics.GetAllUpperCaseTitle(id);

            ViewBag.Keywords = ViewBag.Meta;
            var cacheName = "Tags.GetTagDetail." + id;
            var apps      = _logics.GetViewableApps(db)
                            .Where(n => n.TagAppRelations.Any(tagRel => tagRel.Tag.TagDisplay == tagname))
                            .Include(n => n.User)
                            .OrderByDescending(n => n.AppID);
            int maxItems = (int)AppConfig.Setting.PageItems;

            var pageInfo = new PaginationInfo {
                ItemsInPage = maxItems,
                PageNumber  = page,
            };
            var appsForThisPage =
                apps.GetPageData(pageInfo, CacheNames.ProfilePaginationDataForSpecificProfile, true)
                .ToList();

            _logics.GetEmbedImagesWithApp(appsForThisPage, db, maxItems, GalleryCategoryIDs.SearchIcon);
            ViewBag.Apps = appsForThisPage;
            var eachUrl = ControllerUrl + "/" + id + "?page=@page";

            ViewBag.paginationHtml = new HtmlString(Pagination.GetList(pageInfo, eachUrl, "", maxNumbersOfPagesShow: MaxNumbersOfPagesShow));
            ViewBag.tagName        = tagname;
            ViewBag.breadcrumbs    = _logics.GetBredcrumbsBasedOnCurrentUrl();
            return(View());
        }
Esempio n. 3
0
        public async Task <ActionResult> SingleAppDisplay(string platform, float?platformVersion, string category,
                                                          string url)
        {
            var app = _logics.GetSingleAppForDisplay(platform, platformVersion, category, url, 30, db);

            if (app != null)
            {
                _logics.IncreaseViewCount(app, db);
                ViewBag.breadcrumbs = _logics.GetBredcrumbsBasedOnCurrentUrl("single-app");
                ViewBag.view        = "SingleAppDisplay"; // js action
                return(View(app));
            }
            return(View("_AppNotFound"));
        }
Esempio n. 4
0
        public ActionResult Profile(string username, int page = 1)
        {
            ApplicationUser user;

            if (UserManager.IsUserNameExistWithValidation(username, out user))
            {
                var algorithms = new Logics();
                ViewBag.Title    = username + "'s apps collection";
                ViewBag.Meta     = "Mobile apps, apps review, apple apps, android apps, " + ViewBag.Title;
                ViewBag.Keywords = ViewBag.Meta;

                if (user != null)
                {
                    var apps = algorithms.GetViewableApps(db)
                               .Where(n => n.PostedByUserID == user.UserID)
                               .Include(n => n.User)
                               .OrderByDescending(n => n.AppID);

                    var pageInfo = new PaginationInfo {
                        ItemsInPage = AppConfig.Setting.PageItems,
                        PageNumber  = page,
                        PagesExists = -1
                    };
                    var appsForThisPage =
                        apps.GetPageData(pageInfo, CacheNames.ProfilePaginationDataForSpecificProfile, true)
                        .ToList();
                    algorithms.GetEmbedImagesWithApp(appsForThisPage, db, (int)pageInfo.ItemsInPage,
                                                     GalleryCategoryIDs.SearchIcon);
                    ViewBag.Apps = appsForThisPage;
                    var eachUrl = "/profiles/" + user.UserName + "?page=@page";
                    ViewBag.paginationHtml = new HtmlString(Pagination.GetList(pageInfo, eachUrl, "",
                                                                               maxNumbersOfPagesShow: MaxNumbersOfPagesShow));
                    ViewBag.breadcrumbs = algorithms.GetBredcrumbsBasedOnCurrentUrl();
                    return(View(user));
                }
            }
            ViewBag.Reason = "User not found.";
            return(View("_404"));
        }