Exemple #1
0
        //[Route("seo/Coupons/{permalink}")]
        public ActionResult Index(string seoParam)
        {
            /* var blogDAC = new BlogDAC();
             * List<BlogDTO> blogs = new List<BlogDTO>();
             * BlogViewModels blogModels = new BlogViewModels();
             * blogModels.Blogs = new List<BlogViewModel>();
             * blogs = blogDAC.ReadAllBlogs();
             * foreach (var blogDto in blogs)
             * {
             *   var blogModel = new BlogViewModel();
             *   blogModel.Description = blogDto.Description;
             *   blogModels.Blogs.Add(blogModel);
             * }*/
            var seoTitle = Request.RawUrl.Replace("/Coupons/", "");

            var productDAC       = new ProductDAC();
            var productDto       = productDAC.ReadProductBySeoTitle(seoTitle);
            var productItemModel = new ProductItemViewModel();

            productItemModel.Description = productDto.Description;
            productItemModel.Name        = productDto.Name;
            productItemModel.SeoTitle    = productDto.SeoTitle;
            productItemModel.ImageURL    = productDto.ImageURL;

            if (seoTitle.IsNullOrWhiteSpace() || productItemModel.SeoTitle.IsNullOrWhiteSpace() || seoTitle == "Index")
            {
                return(RedirectToAction("FourOhFour", "Other"));
            }


            return(View(productItemModel));
        }
        //[Route("seo/Coupons/{permalink}")]
        public ActionResult Index(string seoParam)
        {
            var seoTitle = Request.RawUrl.Replace("/Coupons/", "");

            var productDAC       = new ProductDAC();
            var productDto       = productDAC.ReadProductBySeoTitle(seoTitle);
            var productItemModel = new ProductItemViewModel();

            productItemModel.Description = productDto.Description;
            productItemModel.Name        = productDto.Name;
            productItemModel.Content     = productDto.Content;
            productItemModel.SeoTitle    = productDto.SeoTitle;
            productItemModel.ImageURL    = productDto.ImageURL;

            if (seoTitle.IsNullOrWhiteSpace() || productItemModel.SeoTitle.IsNullOrWhiteSpace() || seoTitle == "Index")
            {
                return(RedirectToAction("FourOhFour", "Other"));
            }


            return(View(productItemModel));
        }
        //[Route("seo/Coupons/{permalink}")]
        public ActionResult Index(string seoParam)
        {
            var seoTitle = Request.RawUrl.Replace("/LocalBoard/", "");

            seoTitle = "paytm-coupons-cashback-offers";//todo
            //todo remove the TMC.Data regerence from the web project later after Service layer implementation
            var productDAC       = new ProductDAC();
            var productDto       = productDAC.ReadProductBySeoTitle(seoTitle);
            var productItemModel = new ProductItemViewModel();

            productItemModel.Description = "";// productDto.Description;
            productItemModel.Name        = productDto.Name;
            productItemModel.Content     = productDto.Content;
            productItemModel.SeoTitle    = "The one stop to all your needs";// productDto.SeoTitle;
            productItemModel.ImageURL    = productDto.ImageURL;

            if (seoTitle.IsNullOrWhiteSpace() || productItemModel.SeoTitle.IsNullOrWhiteSpace() || seoTitle == "Index")
            {
                return(RedirectToAction("FourOhFour", "Other"));
            }


            return(View(productItemModel));
        }