Пример #1
0
        public ActionResult Create()
        {
            var newClient = new ClientManageModel
            {
                Subgroups = _subgroupQueryService.GetAllSubgroups()
            };

            return(View(newClient));
        }
Пример #2
0
        public void SetUserGroups(GroupUpdateModel model)
        {
            using (var dbContextScope = _dbContextScopeFactory.Create())
            {
                var dbContext = dbContextScope.DbContexts.Get <EntityManagerDbContext>();

                var group     = _groupQueryService.GetGroup(model.Group.Id);
                var subgroups = _subgroupQueryService.GetAllSubgroups().Where(x => model.SubgroupId.Contains(x.Id));

                group.SubGroups.Clear();

                if (model.SubgroupId != null)
                {
                    foreach (var subgroup in subgroups)
                    {
                        group.SubGroups.Add(subgroup);
                    }
                }
                dbContext.SaveChanges();
            }
        }
Пример #3
0
        public ActionResult Index()
        {
            var subGroups = _subgroupQueryService.GetAllSubgroups();

            return(View(subGroups));
        }