Exemplo n.º 1
0
 public ActionResult PartList(Guid?GroupID)
 {
     try
     {
         var g = _Group.GetDetail(GroupID.Value);
         ViewBag.TourTitle  = g.TournamentTitle;
         ViewBag.TournamID  = g.TournamentID;
         ViewBag.GroupTitle = g.Title;
         //ViewBag.ParticipantList = ParticipantList(g.SportTypeID, g.ParticipantTypeID, g.CountryID);
         ViewBag.SportTypeID = g.SportTypeID;
         var PING  = _partInGroup.GetItemList(GroupID.Value);
         var model = _participant.GetItemList(g.SportTypeID, g.ParticipantTypeID, g.CountryID);
         foreach (var item in model)
         {
             foreach (var item2 in PING)
             {
                 if (item.ID == item2.ParticipantID)
                 {
                     item.IsEnabled = true;
                     break;
                 }
             }
         }
         return(View(model));
     }
     catch
     {
         return(RedirectToAction("Index", "Tournament"));
     }
 }
Exemplo n.º 2
0
        private List <SelectListItem> PList(Guid?GroupID)
        {
            List <SelectListItem> ls = new List <SelectListItem>();

            foreach (var item in _partInGroup.GetItemList(GroupID.Value))
            {
                ls.Add(new SelectListItem {
                    Text = item.Team, Value = item.ParticipantID.ToString()
                });
            }
            return(ls);
        }