Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 3
0
 public void Delete(Group item)
 {
     this.setList.Remove(item);
 }
Esempio n. 4
0
 public void Add(Group item)
 {
     this.setList.Add(item);
 }
Esempio n. 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();
 }
Esempio n. 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();
 }