public ActionResult MyAssets(string id = null) { if (id == null) { id = Guid.NewGuid().ToString(); return(RedirectToAction("New", new { id = id })); } EstadoUsuario.CurrentListPublicId = id; EDVMyAssets edv = new EDVMyAssets(); SetHeadCounters(); ViewBag.PublicID = id; AgenteShoppingList agente = new AgenteShoppingList(); edv.allowEdit = agente.IsShoppingListOwner(EstadoUsuario.CurrentListPublicId, this.User.Identity == null ? null : this.User.Identity.Name); //Guardamos la shopping list en las de un usuario si se indica en la url agente.SaveListInMyListsIfProceed(this.Request, this.User.Identity, id); EVListSummary summ = agente.SelectListSummaryPorPublicID(id); JavaScriptSerializer serializer = new JavaScriptSerializer(); string itemArray = serializer.Serialize(summ.Items); edv.Summary = summ; edv.IsShoppingListFree = agente.IsShoppingListFree(id); edv.ListNavMenu = new EDPVListNavMenu <Enumerados.StepsForPVPList>(Modelo.Enumerados.StepsForPVPList.MyAssets); return(View(edv)); }
public ActionResult GetList(string id) { SetHeadCounters(); AgenteShoppingList agente = new AgenteShoppingList(); EVListSummary summ = agente.SelectListSummaryPorPublicIDRead(id); ViewBag.PublicID = id; JavaScriptSerializer serializer = new JavaScriptSerializer(); string itemArray = serializer.Serialize(summ.Items); EDVSummary edv = new EDVSummary(); edv.ItemArray = itemArray; edv.Summary = summ; if (summ.PublicID == id) { //Guardamos la shopping list en las de un usuario si se indica en la url agente.SaveListInMyListsIfProceed(this.Request, this.User.Identity, id); edv.IsShoppingListFree = agente.IsShoppingListFree(id); return(View("Summary", edv)); } else { return(View("Public", edv)); } }
public ActionResult ImportFits(string id = null) { if (id == null) { id = Guid.NewGuid().ToString(); return(RedirectToAction("New", new { id = id })); } this.ViewBag.PublicID = id; EstadoUsuario.CurrentListPublicId = id; AgenteShoppingList agente = new AgenteShoppingList(); //Guardamos la shopping list en las de un usuario si se indica en la url agente.SaveListInMyListsIfProceed(this.Request, this.User.Identity, id); //cargamos las fits que puedan estar agregadadas a la shopping list IEnumerable <EVFitting> fits = agente.SelectFitsEnShoppingList(id); EDVImportFits edv = new EDVImportFits(); SetHeadCounters(); edv.allowEdit = agente.IsShoppingListOwner(EstadoUsuario.CurrentListPublicId, this.User.Identity == null ? null : this.User.Identity.Name); EDVFittingsList edvFitList = new EDVFittingsList(); edvFitList.Fittings = fits; edv.Fittings = edvFitList; edv.IsShoppingListFree = agente.IsShoppingListFree(id); if (Request.IsAuthenticated) { EDVMyFittings edvmyfit = FittingsController.GetEDVMyFittingsByUser(User.Identity.Name); edv.MyFittings = edvmyfit; SetupFitListForImportMenu(edvmyfit.Fittings); } edv.ListNavMenu = new EDPVListNavMenu <Enumerados.StepsForPVPList>(Modelo.Enumerados.StepsForPVPList.AddFits); return(View(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)); }