public List <UserGroupForListDto> GetUserGroups(string dawgtag) { //Method Level Variable Declarations List <Exception> excepts = new List <Exception>(); GuacamoleDatabaseGetter getter = new GuacamoleDatabaseGetter(); return(getter.GetUserGroupInfo(dawgtag, ref excepts)); }
public List <ConnectionForListDto> GetAllConnections() { //Method Level Variable Declarations List <Exception> excepts = new List <Exception>(); GuacamoleDatabaseGetter getter = new GuacamoleDatabaseGetter(); return(getter.GetAllConnectionInfo(ref excepts)); }
public GroupForListDto GetConnectionGroupsFromId(int id) { //Method Level Variable Declarations List <Exception> excepts = new List <Exception>(); GuacamoleDatabaseGetter getter = new GuacamoleDatabaseGetter(); GroupForListDto dto = new GroupForListDto(); dto = getter.GetAllConnectionGroupInfo(id, ref excepts); dto.Connections = getter.GetAllGroupConnections(dto.Id, ref excepts); dto.Users = getter.GetAllConnectionGroupUsers(dto.Id, ref excepts); return(dto); }
public List <GroupForListDto> GetConnectionGroups(string dawgtag) { //Method Level Variable Declarations List <Exception> excepts = new List <Exception>(); GuacamoleDatabaseGetter getter = new GuacamoleDatabaseGetter(); List <GroupForListDto> groupList = getter.GetConnectionGroupInfo(dawgtag, ref excepts); foreach (GroupForListDto dto in groupList) { dto.Connections = getter.GetAllGroupConnections(dto.Id, ref excepts); } return(groupList); }
public ActionResult CreateGroup(GroupForCreationDto groupForCreationDto) { //Method Level Variable Declarations List <Exception> excepts = new List <Exception>(); //Check if the group inupt parameters are valid using (Validator checker = new Validator()) { checker.ValidateGroupName(groupForCreationDto.Name, ref excepts); checker.ValidateVmTotal(groupForCreationDto.Max, ref excepts); } if (excepts.Count != 0) { var message = HandleErrors(excepts); return(Ok(null)); } //Format connection group type using (Formatter styler = new Formatter()) { groupForCreationDto.Type = styler.FormatName(groupForCreationDto.Type); } //Get affinity bool string affinityBool = "0"; if (groupForCreationDto.Affinity) { affinityBool = "1"; } //Create connection group GuacamoleDatabaseInserter inserter = new GuacamoleDatabaseInserter(); if (!inserter.InsertConnectionGroup(groupForCreationDto.Name, groupForCreationDto.Type, groupForCreationDto.Max, affinityBool, ref excepts)) { var message = HandleErrors(excepts); return(Ok(null)); } //Get the newly created group id GuacamoleDatabaseGetter getter = new GuacamoleDatabaseGetter(); groupForCreationDto.Id = getter.GetConnectionGroupId(groupForCreationDto.Name, ref excepts); return(Ok(groupForCreationDto)); }