Exemple #1
0
        public RdsServer[] GetRDSServersPaged(int maximumRows, int startRowIndex, string sortColumn, string filterValue)
        {
            rdsServers = ES.Services.RDS.GetRdsServersPaged("", filterValue, sortColumn, startRowIndex, maximumRows);

            foreach (var rdsServer in rdsServers.Servers)
            {
                rdsServer.Status = "...";                
                rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId) != null;
            }

            return rdsServers.Servers;            
        }
Exemple #2
0
        public RdsServer[] GetOrganizationRdsServersPaged(int itemId, int maximumRows, int startRowIndex, string sortColumn, string filterValue)
        {
            rdsServers = ES.Services.RDS.GetOrganizationRdsServersPaged(itemId, null, "", filterValue, sortColumn, startRowIndex, maximumRows);

            return rdsServers.Servers;
        }
        private static RdsServersPaged GetFreeRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
        {
            RdsServersPaged result = new RdsServersPaged();
            Organization org = OrganizationController.GetOrganization(itemId);

            if (org == null)
            {
                return result;
            }

            var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
            var existingServers = rds.GetServersExistingInCollections();

            DataSet ds = DataProvider.GetRDSServersPaged(null, null, filterColumn, filterValue, sortColumn, startRow, maximumRows);            
            result.RecordsCount = (int)ds.Tables[0].Rows[0][0];

            List<RdsServer> tmpServers = new List<RdsServer>();

            ObjectUtils.FillCollectionFromDataView(tmpServers, ds.Tables[1].DefaultView);
            tmpServers = tmpServers.Where(x => !existingServers.Select(y => y.ToUpper()).Contains(x.FqdName.ToUpper())).ToList();
            result.Servers = tmpServers.ToArray();

            return result;
        }
        private static RdsServersPaged GetOrganizationFreeRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
        {
            DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows);

            RdsServersPaged result = new RdsServersPaged();
            result.RecordsCount = (int)ds.Tables[0].Rows[0][0];

            List<RdsServer> tmpServers = new List<RdsServer>();

            ObjectUtils.FillCollectionFromDataView(tmpServers, ds.Tables[1].DefaultView);

            result.Servers = tmpServers.ToArray();

            return result;
        }
        private static RdsServersPaged GetRdsServersPagedInternal(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
        {
            DataSet ds = DataProvider.GetRDSServersPaged(null, null, filterColumn, filterValue, sortColumn, startRow, maximumRows, true, true);

            RdsServersPaged result = new RdsServersPaged();
            result.RecordsCount = (int)ds.Tables[0].Rows[0][0];

            List<RdsServer> tmpServers = new List<RdsServer>();

            ObjectUtils.FillCollectionFromDataView(tmpServers, ds.Tables[1].DefaultView);

            foreach (var tmpServer in tmpServers)
            {
                RemoteDesktopServicesHelpers.FillRdsServerData(tmpServer);                
            }

            result.Servers = tmpServers.ToArray();            

            return result;
        }