Beispiel #1
0
        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));
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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 }));
        }
Beispiel #4
0
        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));
            }
        }
Beispiel #5
0
 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."));
     }
 }
Beispiel #6
0
        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));
        }
Beispiel #7
0
 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."));
     }
 }
Beispiel #8
0
        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));
        }
Beispiel #9
0
        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));
        }