public ActionResult AddGroup(GroupViewModel vm)
        {
            Group group = new Group
            {
                Active = 1,
                Created = DateTime.Now,
                OwnerId = Convert.ToInt32(GetSUD()),
                Title = vm.Title
            };

            Rep.AddGroup(group);
            Rep.Save();

            foreach (var member in vm.AccessList.Where(e => e.Selected))
            {
                GroupMember gm = new GroupMember
                {
                    AccountId = Convert.ToInt32(member.SimpleId),
                    Active = 1,
                    Created = DateTime.Now,
                    GroupId = group.Id
                };

                Rep.AddGroupMember(gm);
            }

            Rep.Save();

            return RedirectToAction("Index");
        }
Пример #2
0
        public void UpdateGroupMember(GroupMember member)
        {
            GroupMember original = GetGroupMemberById(member.Id);

            //context.GroupMember(original).CurrentValues.SetValues(member);

            //Save();
        }
Пример #3
0
 public void AddGroupMember(GroupMember member)
 {
     context.GroupMembers.Add(member);
 }