Пример #1
0
        public static List <GroupViewModel> GetAllGroups()
        {
            List <GroupViewModel> groups    = new List <GroupViewModel>();
            List <Group>          groupList = GroupDB.GetAllGroups();

            groupList.ForEach(g => groups.Add(new GroupViewModel(g.ID, g.Name, g.CreatedDate,
                                                                 g.Receviers.Select(r => r.UserName).ToList())));
            return(groups);
        }
Пример #2
0
        public ActionResult GetGroupsNamesList()
        {
            var groups    = _groupManager.GetAllGroups();
            var namesList = groups.Select(u => new GroupNameViewModel {
                GroupId = u.Id.ToString(), Name = u.Name
            });

            return(Json(namesList, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
 public SearchGroups()
 {
     _groupsManeger = new GroupDB(new Settings());
     _allGroups     = _groupsManeger.GetAllGroups();
 }