Ejemplo n.º 1
0
 private void UpdateFiltersScreen(Object anObj)
 {
     if (!initialized)
     {
         initialized = true;
     }
     else
     {
         // FilterGroupViewModel.PopulateFilterGroups();
     }
     FilterGroupViewModel = new FilterGroupViewModel(this);
 }
 public ActionResult CreateFilterValue(FilterGroupViewModel filterGroup)
 {
     if (ModelState.IsValid)
     {
         FilterValue filterValue = new FilterValue()
         {
             Name = filterGroup.FilterValue
         };
         _context.FiltersValue.Add(filterValue);
         _context.SaveChanges();
         _context.FilterNameGroups.Add(new FilterNameGroup {
             FilterNameId = filterGroup.FilterNameId, FilterValueId = filterValue.Id
         });
         _context.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FilterNameId = new SelectList(_context.FiltersName, "Id", "Name");
     return(View(filterGroup));
 }