internal static EDVMyFittings CommonNavigateMarketGroup(int id, int selFitId, string selFitName, string userName) { EDVMyFittings edv; EDVFittingsList edvFitlist; AgenteFittings agente = new AgenteFittings(); IEnumerable <ShipMarketGroup> marketItems = agente.SelectMarketGroupsByParentID(id, userName); IList <invMarketGroup> marketChain = agente.GetParentGroupsChainForShips(id); invMarketGroup groupActual = marketChain.Last(); marketChain.Remove(groupActual); edv = new EDVMyFittings(); edv.MarketItems = marketItems; edv.MarketChain = marketChain; edv.GroupName = groupActual.marketGroupName; edv.ContextSelectedFitID = selFitId; edv.ContextSelectedFitName = selFitName; edvFitlist = new EDVFittingsList(); edv.Fittings = edvFitlist; edvFitlist.Fittings = agente.SelectFitsByMarketGroup(userName, groupActual.marketGroupID); return(edv); }
public ActionResult NavigateMyFittingsMenu(int id, int selFitId = 0, string selFitName = null) { EDVMyFittings edv = FittingsController.CommonNavigateMarketGroup(id, selFitId, selFitName, User.Identity.Name); SetupFitListForImportMenu(edv.Fittings); return(PartialView("../Fittings/PVPersonalFittingsMenu", edv)); }
public ActionResult MyFittings() { SetHeadCounters(); EDVMyFittings edv = null; edv = GetEDVMyFittingsByUser(User.Identity.Name); return(View(edv)); }
public PartialViewResult NavigateMarketGroup(int id, int selFitId = 0, string selFitName = null) { EDVMyFittings edv = CommonNavigateMarketGroup(id, selFitId, selFitName, User.Identity.Name); edv.Fittings.ShowUnits = false; edv.Fittings.ShowEdit = false; edv.Fittings.ShowDelete = true; return(PartialView("PVPersonalFittingsMenu", edv)); }
internal static EDVMyFittings GetEDVMyFittingsByUser(string userName) { EDVMyFittings edv = new EDVMyFittings(); AgenteFittings agente = new AgenteFittings(); IEnumerable <ShipMarketGroup> marketItems = agente.SelectMarketGroupsByParentID(4, userName); edv.MarketItems = marketItems; EDVFittingsList edvFitList = new EDVFittingsList(); edvFitList.Fittings = new List <EVFitting>(); edv.Fittings = edvFitList; return(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)); }