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); }
public void Update(Group item) { var temp = this.setList.Where(x => x.Id == item.Id).First(); this.setList.Remove(temp); this.setList.Add(item); }
public void Delete(Group item) { this.setList.Remove(item); }
public void Add(Group item) { this.setList.Add(item); }
/// <summary> /// Edits group /// </summary> /// <param name="group">The group to be edited</param> public void EditGroup(Group group) { groupRepo.Update(group); groupRepo.Save(); }
/// <summary> /// Creates group /// </summary> /// <param name="group">The group to be created</param> public void CreateGroup(Group group) { groupRepo.Add(group); groupRepo.Save(); }