public ActionResult MyAssets(string id = null) { if (id == null) { id = Guid.NewGuid().ToString(); return(RedirectToAction("New", new { id = id })); } EstadoUsuario.CurrentListPublicId = id; EDVGroupMyAssets edv = new EDVGroupMyAssets(); SetHeadCounters(); ViewBag.PublicID = id; AgenteGroupLists agente = new AgenteGroupLists(); edv.allowEdit = agente.IsGroupListOwner(id, this.User.Identity == null ? null : this.User.Identity.Name); EVListSummary summ = agente.SelectGroupListSummaryPorPublicID(id); edv.Summary = summ; edv.ListNavMenu = new EDPVListNavMenu <Enumerados.StepsForGroupList>(Modelo.Enumerados.StepsForGroupList.MyAssets); return(View(edv)); }
public ActionResult SaveGroupListHeader(string slName, string slDescription) { AgenteGroupLists agente = new AgenteGroupLists(); string publicID = EstadoUsuario.CurrentListPublicId; agente.ActualizarGroupListHeader(publicID, User.Identity.Name, slName, slDescription); return(new EmptyResult()); }
private ActionResult CreateGroupShoppingList(string slName, string slDescription) { AgenteGroupLists agente = new AgenteGroupLists(); string userName = null; if (Request.IsAuthenticated) { userName = User.Identity.Name; } string id = agente.CreateGroupList(userName, slName, slDescription); return(RedirectToAction("ImportLinks", "Group", new { id = id })); }
public ActionResult RemoveListFromGroup(string id) { AgenteGroupLists agente = new AgenteGroupLists(); try { agente.RemoveListFromGroup(EstadoUsuario.CurrentListPublicId, id, User.Identity.Name); return(new EmptyResult()); } catch (Exception ex) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest, ex.Message)); } }
public ActionResult IncludeStaticListInGroup(string id, string nick) { try { AgenteGroupLists agente = new AgenteGroupLists(); string publicID = agente.IncludeStaticListInGroup(id, EstadoUsuario.CurrentListPublicId, User.Identity.Name, nick); EVStaticList ev = agente.SelectStaticListHeaderById(EstadoUsuario.CurrentListPublicId, publicID); ViewBag.ShowGroupInfo = true; ViewBag.AllowDelete = true; return(PartialView("../Lists/PVStaticShoppingList", ev)); } catch (Exception) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest, "We couldnt include the provided list in the group. It may not be a correct link or the provided list may not exist.")); } }
public ActionResult MyLists() { AgenteShoppingList agente = new AgenteShoppingList(); IEnumerable <EVShoppingListHeader> lists = agente.SelectShoppingListsByUserName(User.Identity.Name); AgenteGroupLists agenteGroup = new AgenteGroupLists(); IEnumerable <EVShoppingListHeader> groupLists = agenteGroup.SelectGroupListsByUserName(User.Identity.Name); EDVMyLists edv = new EDVMyLists() { Lists = lists, GroupLists = groupLists }; SetHeadCounters(); return(View(edv)); }
public ActionResult DeleteList(string id) { try { AgenteGroupLists agente = new AgenteGroupLists(); string userName = null; if (Request.IsAuthenticated) { userName = User.Identity.Name; } agente.DeleteList(userName, id); return(new EmptyResult()); } catch (Exception ex) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest, "The group shopping list doesnt exist or you don't have the right to delete it.")); } }
public ActionResult Summary(string id) { SetHeadCounters(); this.ViewBag.PublicID = id; AgenteGroupLists agente = new AgenteGroupLists(); EVListSummary ev = agente.SelectGroupListSummaryPorPublicID(id); EDVGroupSummary edv = new EDVGroupSummary(); edv.Summary = ev; edv.Summary.ShowDelta = false; IEnumerable <EVStaticList> lists = agente.SelectStaticListsHeadersByGroupId(id); edv.Lists = lists; edv.allowEdit = agente.IsGroupListOwner(id, this.User.Identity == null ? null : this.User.Identity.Name); ViewBag.AllowDelete = false; ViewBag.ShowGroupInfo = true; edv.ListNavMenu = new EDPVListNavMenu <Enumerados.StepsForGroupList>(Modelo.Enumerados.StepsForGroupList.Summary); return(View(edv)); }
public ActionResult ImportLinks(string id) { SetHeadCounters(); this.ViewBag.PublicID = id; AgenteGroupLists agente = new AgenteGroupLists(); if (!agente.IsGroupListOwner(id, User.Identity.Name)) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest, Messages.err_notAuthorizedForPage)); } IEnumerable <EVStaticList> lists = agente.SelectStaticListsHeadersByGroupId(EstadoUsuario.CurrentListPublicId); EDVImportLinks edv = new EDVImportLinks { Lists = lists }; ViewBag.ShowGroupInfo = true; edv.ListNavMenu = new EDPVListNavMenu <Enumerados.StepsForGroupList>(Modelo.Enumerados.StepsForGroupList.AddLists); return(View(edv)); }