Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }