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));
        }