public ActionResult Archive() { var devices = _repository.Devices.Where(d => !d.Name.IsGroup()); var model = new ProductsModel { ActiveSection = new SectionModel { Title = NetPing_modern.Resources.Views.Catalog.Index.Sec_archive, IsSelected = true, Description = NetPing_modern.Resources.Views.Catalog.Index.Sec_archive_desc } }; model.Devices = devices.Where(d => d.IsInArchive); return View(model); }
public ActionResult Solutions() { var solutionsNames = new[] { "dlja-servernyh-komnat-i-6kafov", "udaljonnoe-upravlenie-jelektropitaniem", "re6enija-na-osnove-POE" }; var model = new ProductsModel { ActiveSection = NavigationProvider.GetAllSections().First(s => s.Url == "solutions") }; var devices = new List<Device>(); foreach (var solutionName in solutionsNames) { var sub = _repository.Devices.FirstOrDefault(d => d.Url == solutionName); if (sub != null) { devices.AddRange(_repository.Devices.Where(d => !d.Name.IsGroup() && d.Name.IsUnderOther(sub.Name))); } } model.Devices = devices; model.ActiveSection.IsSelected = true; var sections = NavigationProvider.GetAllSections().Where(m => m.Url != model.ActiveSection.Url); sections.ForEach(m => model.Sections.Add(m)); //return View(model); return View("Adaptive_Index", model); }
public ActionResult Index(string group, string id) { var devices = _repository.Devices.Where(d => !d.Name.IsGroup()); var groups = _repository.Devices.Where(d => d.Name.IsGroup()); if (group == null) return HttpNotFound(); var g = _repository.Devices.FirstOrDefault(d => d.Url == @group); if (g != null) { if (!g.Name.IsGroup()) return Device_view(group); // Open device page devices = devices.Where(d => !d.Name.IsGroup() && d.Name.IsUnderOther(g.Name)); } else { return HttpNotFound(); } ViewBag.Title = g.Name.Name; ViewBag.Description = g.Name.Name; ViewBag.Keywords = g.Name.Name; var model = new ProductsModel { ActiveSection = NavigationProvider.GetAllSections().FirstOrDefault(m => m.Url == @group) }; if (!string.IsNullOrEmpty(id)) { var sub = _repository.Devices.FirstOrDefault(d => d.Url == id); if (sub != null) { devices = _repository.Devices.Where(d => !d.Name.IsGroup() && d.Name.IsUnderOther(sub.Name)); ViewBag.Title = sub.Name.Name; ViewBag.Description = sub.Name.Name; ViewBag.Keywords = sub.Name.Name; } else { return HttpNotFound(); } model.ActiveSection = model.ActiveSection.Sections.First(m => m.Url == id); } else { model.ActiveSection.Sections.First().IsSelected = true; } model.Devices = devices.Where(d => !d.IsInArchive); model.ActiveSection.IsSelected = true; var sections = NavigationProvider.GetAllSections().Where(m => m.Url != model.ActiveSection.Url); sections.ForEach(m => model.Sections.Add(m)); //return View(model); return View("Adaptive_Index", model); }
public ActionResult Development() { var devices = _repository.Devices.Where(d => !d.Name.IsGroup() && d.Name.Path.Contains("Development")); var model = new ProductsModel { ActiveSection = NavigationProvider.GetAllSections().FirstOrDefault(m => m.Url == "development") }; ViewBag.Title = ViewBag.Description = ViewBag.Keywords = model.ActiveSection.FormattedTitle; model.Devices = devices; return View("Adaptive_Index", model); }