示例#1
0
 public ActionResult Create(GroupAdminGroupCreateViewModel viewModel)
 {
     if (ModelState.IsValid)
     {
         var group = new Group
         {
             Name = viewModel.Name,
             OwnerId = WebSecurity.GetUserId(User.Identity.Name),
             Type = viewModel.Type,
         };
         groupService.CreateGroup(group);
         return Redirect("/GroupAdmin/Group");
     }
     return View(viewModel);
 }
示例#2
0
 public void Update(Group item)
 {
     var temp = this.setList.Where(x => x.Id == item.Id).First();
     this.setList.Remove(temp);
     this.setList.Add(item);
 }
示例#3
0
 public void Delete(Group item)
 {
     this.setList.Remove(item);
 }
示例#4
0
 public void Add(Group item)
 {
     this.setList.Add(item);
 }
示例#5
0
 /// <summary>
 /// Edits group
 /// </summary>
 /// <param name="group">The group to be edited</param>
 public void EditGroup(Group group)
 {
     groupRepo.Update(group);
     groupRepo.Save();
 }
示例#6
0
 /// <summary>
 /// Creates group
 /// </summary>
 /// <param name="group">The group to be created</param>
 public void CreateGroup(Group group)
 {
     groupRepo.Add(group);
     groupRepo.Save();
 }