private List <SearchAttribute> GetListOfSearchAttributes(List <SearchAttributeViewModel> listOfViewModels) { List <SearchAttribute> listOfSearchAttributes = new List <SearchAttribute>(); foreach (SearchAttributeViewModel savm in listOfViewModels) { listOfSearchAttributes.Add(SearchAttributeViewModel.GetSearchAttribute(savm)); } return(listOfSearchAttributes); }
private List <SearchAttributeViewModel> GetListOfSearchAttributeViewModels(List <SearchAttribute> listOfSearchAttributes) { List <SearchAttributeViewModel> listOfSearchAttributeViewModels = new List <SearchAttributeViewModel>(); foreach (SearchAttribute sa in listOfSearchAttributes) { listOfSearchAttributeViewModels.Add(SearchAttributeViewModel.GetSearchAttributeViewModel(sa)); } return(listOfSearchAttributeViewModels); }
public ActionResult Add() { ViewBag.Title = PresentationModel.GetViewTitleForTenant("Manage Search", this.Session.GetTenant()); List <SearchAttributeViewModel> searchAttributeList = (List <SearchAttributeViewModel>)Session["searchAttributeList"]; SearchAttributeViewModel sa = new SearchAttributeViewModel(); sa.id = searchAttributeList.Count; ViewData["windowVisible"] = true; ViewData["selectedSearchAttribute"] = sa; return(View("SearchDesigner", (List <SearchAttributeViewModel>)Session["searchAttributeList"])); }
public ActionResult Save(SearchAttributeViewModel model) { //setluceneName if (ModelState.IsValid) { //if (submit != null) //{ List <SearchAttributeViewModel> searchAttributeList = (List <SearchAttributeViewModel>)Session["searchAttributeList"]; if (searchAttributeList.Where(p => p.id.Equals(model.id)).Count() > 0) { SearchAttributeViewModel temp = searchAttributeList.Where(p => p.id.Equals(model.id)).First(); searchAttributeList[searchAttributeList.IndexOf(temp)] = model; } else { searchAttributeList.Add(model); } ISearchDesigner sd = GetSearchDesigner(); //sd.Set(searchAttributeList); Session["searchAttributeList"] = searchAttributeList; ViewData["windowVisible"] = false; //create new config FileStream SaveConfig(); //} return(Json(true)); } else { ViewData["windowVisible"] = true; } return(Json(false)); //return View("SearchDesigner", (List<SearchAttributeViewModel>)Session["searchAttributeList"]); }