public ActionResult SaveTag(List <ChampionTag> championTagList, Guid playerId) { var dalTag = new DALTag(); int result = dalTag.SaveTag(championTagList); return(RedirectToAction("Tag", new { playerId = playerId })); }
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 })); }
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 })); }
// 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)); }
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); }