public ActionResult Tags(int?id, bool isTag = true)
        {
            var model = new TagsVM
            {
                SelectedTag = isTag ? id : null,
                Tags        = isTag ? unitOfWork.Tags : from taggedProduct in unitOfWork.TaggedProducts.Find(x => x.ProductId == id)
                              join tag in unitOfWork.Tags on taggedProduct.TagId equals tag.Id
                              select tag
            };

            return(PartialView(model));
        }
        public ActionResult Tags()
        {
            var model = new TagsVM()
            {
                Tags = new List <Tag>()
                {
                    new Tag()
                    {
                        ID = 1, Title = "Veg", Description = "Vegetarain items", Discount = 14.50f, CreatedOn = DateTime.Now.AddDays(-10).Date, IsAvailable = true
                    },
                    new Tag()
                    {
                        ID = 2, Title = "Non-Veg", Description = "Non-Vegetarain items", Discount = 0.00f, CreatedOn = DateTime.Now.Date.AddDays(-10), IsAvailable = true
                    },
                    new Tag()
                    {
                        ID = 3, Title = "Chicken", Description = "Chicken Items", Discount = 0.00f, CreatedOn = DateTime.Now.Date.AddDays(-9), IsAvailable = false
                    },
                    new Tag()
                    {
                        ID = 4, Title = "Sea Food", Description = "items like fish, pawns", Discount = 0.00f, CreatedOn = DateTime.Now.Date.AddDays(-9), IsAvailable = true
                    },
                    new Tag()
                    {
                        ID = 5, Title = "fish", Description = "fish items", Discount = 10.00f, CreatedOn = DateTime.Now.Date.AddDays(-8), IsAvailable = false
                    },
                    new Tag()
                    {
                        ID = 6, Title = "Dosa", Description = "Dosa items", Discount = 0.00f, CreatedOn = DateTime.Now.Date.AddDays(-8), IsAvailable = true
                    },
                    new Tag()
                    {
                        ID = 7, Title = "Paneer", Description = "Paneer items", Discount = 0.00f, CreatedOn = DateTime.Now.Date.AddDays(-5), IsAvailable = true
                    },
                    new Tag()
                    {
                        ID = 8, Title = "Chinese", Description = "Chinese dishes", Discount = 5.50f, CreatedOn = DateTime.Now.Date.AddDays(-5), IsAvailable = false
                    },
                    new Tag()
                    {
                        ID = 9, Title = "South Indain", Description = "South Indain items", Discount = 0.00f, CreatedOn = DateTime.Now.Date.AddDays(-5), IsAvailable = true
                    },
                    new Tag()
                    {
                        ID = 10, Title = "North Indain", Description = "North Indain", Discount = 0.00f, CreatedOn = DateTime.Now.Date.AddDays(-5), IsAvailable = false
                    },
                }
            };

            return(View(model));
        }
Example #3
0
 public static IHtmlString _GetPreviousPage(this HtmlHelper helper, TagsVM tagsVM)
 {
     return(GetUrl(tagsVM.Page - 1));
 }
Example #4
0
 public static IHtmlString _GetNextPage(this HtmlHelper helper, TagsVM tagsVM)
 {
     return(GetUrl(tagsVM.Page + 1));
 }