public void SaveGroup(Group group, HttpPostedFile file, List <long> selectedGroupTypeIDs) { if (group.Description.Length > 2000) { _view.ShowMessage("Your description is " + group.Description.Length.ToString() + " characters long and can only be 2000 characters!"); } else { group.AccountID = _webContext.CurrentUser.AccountID; group.PageName = group.PageName.Replace(" ", "-"); if (group.GroupID == 0 && _groupRepository.CheckIfGroupPageNameExists(group.PageName)) { _view.ShowMessage("The page name you specified is already in use!"); } else { if (file.ContentLength > 0) { List <Int64> fileIDs = _fileService.UploadPhotos(1, _webContext.CurrentUser.AccountID, _webContext.Files, 2); //should only be one item uploaded! if (fileIDs.Count == 1) { group.FileID = fileIDs[0]; } } group.GroupID = _groupService.SaveGroup(group); _groupToGroupTypeRepository.SaveGroupTypesForGroup(selectedGroupTypeIDs, group.GroupID); _redirector.GoToGroupsViewGroup(group.PageName); } } }
public void GoToGroup(string GroupPageName) { _redirector.GoToGroupsViewGroup(GroupPageName); }
public void Back() { _redirector.GoToGroupsViewGroup(_webContext.GroupID); }