Beispiel #1
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));
        }