Пример #1
0
        public GroupViewModel(Group group, ICollection<User> currentUsers, ICollection<User> allUsers)
        {
            Group = group;
            CurrentUsers = currentUsers;
            AllUsers = allUsers;

            if (Group == null)
            {
                Group = new Group();
            }
        }
Пример #2
0
        public Group Save(Group group)
        {
            using (var context = GetContext())
            {
                if (group.Id == 0)
                {
                    context.Entry<Group>(group).State = System.Data.EntityState.Added;
                }
                else
                {
                    context.Entry<Group>(group).State = System.Data.EntityState.Modified;
                }

                context.SaveChanges();

                return group;
            }
        }
Пример #3
0
 public JsonResult Save(Group group)
 {
     return Json(null);
 }