Пример #1
0
 private static SiteDto getSiteDtoFromISite(ISite site)
 {
     if (site == null)
     {
         throw new Exception("站点不存在!");
     }
     return(SiteDto.ConvertFromSite(site));
 }
Пример #2
0
 private static SiteDto GetSiteDtoFromISite(ISite site)
 {
     if (site != null)
     {
         return(SiteDto.ConvertFromSite(site));
     }
     return(default(SiteDto));
 }
Пример #3
0
        public IList <DataTransfer.SiteDto> GetSites()
        {
            IList <SiteDto> siteDtos = new List <SiteDto>();
            IList <ISite>   sites    = _resp.GetSites();

            foreach (ISite site in sites)
            {
                siteDtos.Add(SiteDto.ConvertFromSite(site));
            }
            return(siteDtos);
        }
Пример #4
0
        public IList <SiteDto> GetSites()
        {
            IList <SiteDto> siteDtos = new List <SiteDto>();
            IList <ISite>   sites    = repo.GetSites();

            foreach (ISite site in sites)
            {
                siteDtos.Add(SiteDto.ConvertFromSite(site));
            }
            return(siteDtos);
        }
Пример #5
0
        public SiteDto[] GetUserRelationSites(int userId)
        {
            IDictionary <int, AppRolePair> data = this._userRepository.GetUserRoles(userId);
            int len = data.Keys.Count;

            SiteDto[] sites = new SiteDto[len];
            if (len > 0)
            {
                int i = 0;
                foreach (var key in data.Keys)
                {
                    sites[i++] = SiteDto.ConvertFromSite(this._siteRepository.GetSiteById(data[key].AppId));
                }
            }
            return(sites);
        }