public PartialViewResult NavigateMarketGroup(int id) { AgenteMarketItems agente = new AgenteMarketItems(); IEnumerable <EVMarketItem> marketItems = agente.SelectMarketGroupsByParentID(id); IList <invMarketGroup> marketChain = agente.GetParentGroupsChain(id); invMarketGroup groupActual = marketChain.Last(); marketChain.Remove(groupActual); EDVAddMarketItems edv = new EDVAddMarketItems(); edv.MarketItems = marketItems; edv.MarketChain = marketChain; edv.GroupName = groupActual.marketGroupName; return(PartialView("PVMarketMenu", edv)); }
public ActionResult AddMarketItems(string id) { if (id == null) { id = Guid.NewGuid().ToString(); return(RedirectToAction("New", new { id = id })); } this.ViewBag.PublicID = id; EstadoUsuario.CurrentListPublicId = id; if (string.IsNullOrEmpty(id)) { throw new ApplicationException(Messages.err_requestWithoutPublicID); } AgenteMarketItems agente = new AgenteMarketItems(); AgenteShoppingList agenteShList = new AgenteShoppingList(); //Guardamos la shopping list en las de un usuario si se indica en la url agenteShList.SaveListInMyListsIfProceed(this.Request, this.User.Identity, id); IEnumerable <EVMarketItem> marketItems = agente.SelectMarketGroupsByParentID(null); IEnumerable <MarketItem> marketItemsEnShoppingList = agenteShList.SelectMarketItemsEnShoppingList(id); EDVAddMarketItems edv = new EDVAddMarketItems(); edv.allowEdit = agenteShList.IsShoppingListOwner(EstadoUsuario.CurrentListPublicId, this.User.Identity == null ? null : this.User.Identity.Name); SetHeadCounters(); edv.MarketItems = marketItems; edv.IsShoppingListFree = agenteShList.IsShoppingListFree(id); edv.MarketItemsEnShoppingList = marketItemsEnShoppingList; edv.ListNavMenu = new EDPVListNavMenu <Enumerados.StepsForPVPList>(Modelo.Enumerados.StepsForPVPList.AddMarketItems); return(View(edv)); }