Пример #1
0
        public ActionResult SaveTag(List <ChampionTag> championTagList, Guid playerId)
        {
            var dalTag = new DALTag();
            int result = dalTag.SaveTag(championTagList);

            return(RedirectToAction("Tag", new { playerId = playerId }));
        }
Пример #2
0
        public ActionResult AddTag(string tagName, Guid playerId)
        {
            var dal    = new DALTag();
            int result = dal.AddTag(tagName, playerId);

            //TODO : manage result value
            return(RedirectToAction("Tag", new { playerId = playerId }));
        }
Пример #3
0
        public ActionResult DeleteTag(Guid tagId, Guid playerId)
        {
            var dal    = new DALTag();
            int result = dal.DeleteTag(tagId, playerId);

            //TODO : manage result value
            return(RedirectToAction("Tag", new { playerId = playerId }));
        }
Пример #4
0
        // GET: Tag
        public ActionResult Tag(Guid playerId)
        {
            var dalChampionPool = new DALChampionPool();
            var dalTag          = new DALTag();

            ViewBag.MyChampionPool  = dalChampionPool.getChampionPool(playerId);
            ViewBag.PlayerId        = playerId;
            ViewBag.Nickname        = new DAL().getPlayerById(playerId).Nickname;
            ViewBag.ListTags        = SelectListHelper.getAllTags(playerId);
            ViewBag.ListChampionTag = dalTag.GetAllChampionTagsByPlayerId(playerId);
            var tags = dalTag.GetAllTagsByPlayerId(playerId);

            return(View(tags));
        }
Пример #5
0
        public static SelectList getAllTags(Guid playerId)
        {
            var dalTag         = new DALTag();
            var list           = dalTag.GetAllTagsByPlayerId(playerId);
            var listSelectItem = new List <SelectListItem>();

            listSelectItem.Add(new SelectListItem()
            {
                Text = "----------- Choose a Tag -----------", Value = ""
            });
            foreach (var item in list)
            {
                listSelectItem.Add(new SelectListItem()
                {
                    Text = item.TagName, Value = item.TagId.ToString()
                });
            }
            var selectlist = new SelectList(listSelectItem, "Value", "Text");

            return(selectlist);
        }