Exemple #1
0
        public ActionResult Articles()
        {
            int totalRecords = 0;
            int pageSize = 10;
            var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents();

            if (string.IsNullOrEmpty(Request.QueryString[SiteEnums.QueryStringNames.pg.ToString()]))
            {
                totalRecords = model.GetContentPageWiseAll(1, pageSize);
            }
            else
            {
                int pageNumber = Convert.ToInt32(Request.QueryString[SiteEnums.QueryStringNames.pg.ToString()]);

                totalRecords = model.GetContentPageWiseAll(pageNumber, pageSize);
            }

            ViewBag.PageCount = (totalRecords + pageSize - 1) / pageSize;

            return View(model);
        }
Exemple #2
0
        public ActionResult Articles()
        {
            mu = Membership.GetUser();

            int totalRecords = 0;
            int pageSize = 10;
            var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents();

            if (string.IsNullOrEmpty(Request.QueryString[SiteEnums.QueryStringNames.pg.ToString()]))
            {
                //totalRecords =
                model.GetContentForUser(Convert.ToInt32(mu.ProviderUserKey));

                model.Sort(delegate(Content p1, Content p2)
                {
                    return p2.ReleaseDate.CompareTo(p1.ReleaseDate);
                });
            }
            else
            {
                int pageNumber = Convert.ToInt32(Request.QueryString[SiteEnums.QueryStringNames.pg.ToString()]);

                totalRecords = model.GetContentPageWiseAll(pageNumber, pageSize);
            }

            ViewBag.PageCount = (totalRecords + pageSize - 1) / pageSize;

            return View(model);
        }
Exemple #3
0
        public JsonResult TagItems(int pageNumber, string key)
        {
            var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents();

            model.GetContentAllPageWiseKey(pageNumber, pageSize, key);

            if (model.Count == 0)
            {
                // this might have had a dash in it
                model.GetContentAllPageWiseKey(1, pageSize, ViewBag.KeyName);

                if (model.Count == 0)
                {
                    // TODO: combination of with and without, deal with it
                }
            }

            StringBuilder sb = new StringBuilder();

            foreach (BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Content cnt in model)
            {
                sb.Append(cnt.ToUnorderdListItem);
            }

            return Json(new
            {
                ListItems = sb.ToString()
            });
        }
Exemple #4
0
        public ActionResult Tag(string key)
        {
            if (string.IsNullOrEmpty(key)) return new EmptyResult();

            ViewBag.KeyName = key;

            key = key.Replace("-", " ");

            var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents();

            model.GetContentAllPageWiseKey(1, pageSize, key);

            if (model.Count == 0)
            {
                // this might have had a dash in it
                model.GetContentAllPageWiseKey(1, pageSize, ViewBag.KeyName );

                if (model.Count == 0)
                {
                    // TODO: combination of with and without, deal with it
                }
            }

            ViewBag.EnableLoadingMore = (model.Count < pageSize);

            ViewBag.TagName = key;

            LoadTagCloud();

            return View(model);
        }
Exemple #5
0
        public JsonResult LangItems(int pageNumber, string lang)
        {
            ViewBag.Lang = lang;

            var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents();

            model.GetContentPageWise(pageNumber, pageSize, lang);

            StringBuilder sb = new StringBuilder();

            foreach (BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Content cnt in model)
            {
                sb.Append(cnt.ToUnorderdListItem);
            }

            return Json(new
            {
                ListItems = sb.ToString()
            });
        }
Exemple #6
0
        public ActionResult Lang(string lang)
        {
            ViewBag.Lang = lang;

            var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents();

            model.GetContentPageWise(1, pageSize, lang);

            LoadTagCloud();

            LoadLang();

            ViewBag.EnableLoadingMore = (model.Count >= pageSize);

            return View(model);
        }
Exemple #7
0
        public ActionResult Index()
        {
            var model = new BootBaronLib.AppSpec.DasKlub.BOL.UserContent.Contents();

            //model.GetContentPageWise(1, pageSize, Utilities.GetCurrentLanguageCode());
            model.GetContentPageWiseAll(1, pageSize);

            LoadTagCloud();

            LoadLang();

            return View(model);
        }