Example #1
0
        public ActionResult Edit(int id)
        {
            Chronicle chronicle = _chronicleService.GetById(id);

            if (chronicle == null)
            {
                AR.Setfailure(Messages.HttpNotFound);
                return(Json(AR, JsonRequestBehavior.AllowGet));
            }

            var vm = _mapper.Map <ChronicleIM>(chronicle);

            var pageMeta = _pageMetaServices.GetPageMeta(ModelType.CHRONICLE, vm.Id.ToString());

            if (pageMeta != null)
            {
                vm.SEOTitle       = pageMeta.Title;
                vm.Keywords       = pageMeta.Keyword;
                vm.SEODescription = pageMeta.Description;
            }

            ViewBag.Years  = new SelectList(DateTimeHelper.GetYearList(2010));
            ViewBag.Months = new SelectList(DateTimeHelper.GetMonthList());
            ViewBag.Days   = new SelectList(DateTimeHelper.GetDayList());

            return(PartialView("_Edit", vm));
        }
        public ActionResult Edit(int id)
        {
            Video video = _videoServices.GetById(id);

            if (video == null)
            {
                AR.Setfailure(Messages.HttpNotFound);
                return(Json(AR, JsonRequestBehavior.AllowGet));
            }

            var vm = _mapper.Map <VideoIM>(video);

            var pageMeta = _pageMetaServices.GetPageMeta(ModelType.VIDEO, vm.Id.ToString());

            if (pageMeta != null)
            {
                vm.SEOTitle    = pageMeta.Title;
                vm.Keywords    = pageMeta.Keyword;
                vm.Description = pageMeta.Description;
            }

            var categorys  = _categoryServices.GetAll().OrderByDescending(m => m.Importance).ToList();
            var lCategorys = new SelectList(categorys, "Id", "Title");

            ViewBag.Categories = lCategorys;

            return(PartialView("_Edit", vm));
        }
        // GET: About
        public ActionResult Index()
        {
            var url = Request.RawUrl;

            ViewBag.PageMeta = _pageMetaService.GetPageMeta(ModelType.MENU, url);

            return(View());
        }
Example #4
0
        public ActionResult Edit(int id)
        {
            VideoCategory category = _categoryServices.GetById(id);

            if (category == null)
            {
                AR.Setfailure(Messages.HttpNotFound);
                return(Json(AR, JsonRequestBehavior.AllowGet));
            }

            var vm = _mapper.Map <VideoCategoryIM>(category);

            var pageMeta = _pageMetaServices.GetPageMeta(ModelType.VIDEOCATEGORY, category.Id.ToString());

            if (pageMeta != null)
            {
                vm.SEOTitle       = pageMeta.Title;
                vm.Keywords       = pageMeta.Keyword;
                vm.SEODescription = pageMeta.Description;
            }

            return(PartialView("_Edit", vm));
        }
        // GET: Chronicle
        public ActionResult Index(int?year)
        {
            var url = Request.RawUrl;

            ViewBag.PageMeta = _pageMetaService.GetPageMeta(ModelType.MENU, url);
            if (year == null)
            {
                var cyear = DateTime.Now.Year;
                var chs   = _chronicleService.GetActiveByYear(cyear);
                ViewData["Year"] = cyear;
                if (!chs.Any())
                {
                    var vm = _chronicleService.GetActiveByYear(cyear - 1);
                    ViewData["Year"] = cyear - 1;
                    return(View(vm));
                }
                return(View(chs));
            }

            var vm1 = _chronicleService.GetActiveByYear(year.Value);

            ViewData["Year"] = year;
            return(View(vm1));
        }