コード例 #1
0
        public PartialViewResult AdminAddUserToGroupRoleForm(string groupName)
        {
            var vm = new AddUserToGroupRoleModel();

            vm.GroupName = groupName;
            return(PartialView("_PartialAddUserToGroupRoleForm", vm));
        }
コード例 #2
0
        public PartialViewResult AdminAddUserToGroupRoleForm(int groupId)
        {
            using (var db = new ZapContext())
            {
                var g         = db.Groups.FirstOrDefault(grp => grp.GroupId == groupId);
                var groupName = "";

                if (g == null)
                {
                    // TODO: handle group not found
                }

                groupName = g.GroupName;
                var vm = new AddUserToGroupRoleModel();
                vm.GroupName = groupName;
                return(PartialView("_PartialAddUserToGroupRoleForm", vm));
            }
        }