public ActionResult ShowByGroupSlug(string slug, int?p) { int limit = 12; try { limit = int.Parse(ThemesSetting.getValue("ProductPageLimit").ToString()); } catch { } var group = _productSevice.GetProductClassBySlug(slug); if (group == null) { return(RedirectToAction("Index")); } var findter = _productSevice.GetFindterProduct(); findter.AddGroupId(group.Id); var count = findter.GetCount(); var Paging = CalcPaging(limit, p, count); var model = new CategoryProductListViewModel { Group = group, Paging = Paging, ListProduct = findter.GetList(limit, Paging.Page) }; return(View(model)); }
// GET: Plugin public ActionResult ComputerBuilding() { var viewModel = new PluginComputerBuildingViewModel(); viewModel.ProductClass = new List <PluginProductClassViewModel>(); dynamic value = ThemesSetting.getValue("ComputerBuilding"); foreach (var it in value) { var id = new Guid((string)it.Value); var cat = _productSevice.GetProductClass(id); if (cat == null) { continue; } var a = new PluginProductClassViewModel { Id = id, Name = cat.Name.ToUpper() }; viewModel.ProductClass.Add(a); } return(View(viewModel)); }
public ActionResult ShowBySlug(string Slug, int?p) { var cat = _categoryService.GetBySlug(Slug); if (cat == null) { return(Redirect("/" + SiteConstants.Instance.CategoryUrlIdentifier)); } int limit = 10; try { limit = int.Parse(ThemesSetting.getValue("TopicPageLimit").ToString()); } catch { } var count = _topicServic.GetCount(cat.Id); var Paging = CalcPaging(limit, p, count); var model = new CategoryTopicListViewModel { Cat = cat, Paging = Paging, ListTopic = _topicServic.GetList(cat.Id, limit, Paging.Page) }; return(View(model)); }
public ActionResult ThemeConfig1(string id) { //Request.Form["svd"] ViewBag.id = id; ViewBag.json = ThemesSetting.getSettingTheme(id); foreach (var item in ViewBag.json) { switch ((string)item.Value.Type) { case "Number": case "Text": case "MenuID": case "CategoryID": case "NewsID": case "ProductID": case "ProductClassID": case "CarouselID": string buf = Request.Form[(string)item.Name]; item.Value.Value = buf; break; case "ListProductClass": case "ListNews": case "ListCategoryProduct": var lst = new List <string>(); int i = 1; while (true) { string key = string.Concat(item.Name, "[", i, "]"); string text = Request.Form[key]; if (text == null) { break; } if (text != "") { lst.Add(text); } i++; } item.Value.Value = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(lst)); break; } } ThemesSetting.setSettingTheme(id, ViewBag.json); return(View("ThemeConfig")); }
public ActionResult ThemeConfig(string id) { ViewBag.id = id; ViewBag.json = ThemesSetting.getSettingTheme(id); return(View()); }
public ActionResult ShowBySlugProduct(string Slug, int?p, List <Guid> group) { var cat = _categoryService.GetBySlug(Slug); if (cat == null) { return(Redirect("/" + SiteConstants.Instance.ProductUrlIdentifier)); } var cats = _categoryService.GetTreeCategories(cat); var ProductFindter = _productSevice.GetFindterProduct(); if (group != null) { ProductFindter.AddGroupId(group); } else { group = new List <Guid>(); } if (cats != null) { ProductFindter.AddCat(cats); } var groupclass = _productSevice.GetClassByProducts(cats); var attr = _productSevice.GetAttributeByClass(groupclass, true); List <CategoryProductFindterViewModel> Attributes = new List <CategoryProductFindterViewModel>(); foreach (var it in attr) { var cl = new CategoryProductFindterViewModel { Name = it.LangName, Title = string.Concat("Product.Attribute.", it.LangName), Options = new List <CategoryProductFindterOption>() }; if (it.ValueType == 2) { if (it.ValueOption.IsNullEmpty()) { continue; } dynamic json = JsonConvert.DeserializeObject(it.ValueOption); if (json == null) { continue; } foreach (var itt in json) { var pit = new CategoryProductFindterOption { Value = itt, Text = itt, }; if (Request[string.Concat(cl.Name, ".", pit.Value)] == "1") { pit.Check = true; ProductFindter.SetAttributeEquas(it.Id, (string)itt); } cl.Options.Add(pit); } } Attributes.Add(cl); } int limit = 10; try { limit = int.Parse(ThemesSetting.getValue("ProductPageLimit").ToString()); } catch { } var count = ProductFindter.GetCount(); var Paging = CalcPaging(limit, p, count); var model = new CategoryProductListViewModel { Cat = cat, Paging = Paging, ListProduct = ProductFindter.GetList(limit, Paging.Page), GroupProducts = groupclass, GroupSelect = group, Attributes = Attributes }; return(View(model)); }