示例#1
0
        /// <summary>
        /// Returns Identity host address based on the provided host and application
        /// </summary>
        /// <param name="host"></param>
        /// <param name="InfotrakApp"></param>
        /// <returns></returns>
        public string getDealershipIdentityAddressByHost(string host, InfotrakApplications InfotrakApp)
        {
            IEnumerable <DealershipBranding> brandedrecords;

            switch (InfotrakApp)
            {
            case InfotrakApplications.IdentityServer:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.IdentityHost == host);
                break;

            case InfotrakApplications.UC:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.UCHost == host);
                break;

            case InfotrakApplications.UCUI:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.UCUIHost == host);
                break;

            case InfotrakApplications.GET:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.GETHost == host);
                break;

            case InfotrakApplications.GETUI:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.GETUIHost == host);
                break;

            default:
                return(ApplicationDefaultURIs.IdentityServer);
            }
            if (brandedrecords.Count() == 0)
            {
                return(ApplicationDefaultURIs.IdentityServer);
            }
            return(brandedrecords.First().IdentityHost);
        }
示例#2
0
        public byte[] getDealershipLogoByHost(string host, InfotrakApplications InfotrakApp)
        {
            IEnumerable <DealershipBranding> brandedrecords;

            switch (InfotrakApp)
            {
            case InfotrakApplications.IdentityServer:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.IdentityHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(getDefaultTrackTreadLogo());
                }
                return(brandedrecords.First().DealershipLogo);

            case InfotrakApplications.UC:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.UCHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(getDefaultTrackTreadLogo());
                }
                return(brandedrecords.First().DealershipLogo);

            case InfotrakApplications.UCUI:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.UCUIHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(getDefaultTrackTreadLogo());
                }
                return(brandedrecords.First().DealershipLogo);

            case InfotrakApplications.GET:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.GETHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(getDefaultTrackTreadLogo());
                }
                return(brandedrecords.First().DealershipLogo);

            case InfotrakApplications.GETUI:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.GETUIHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(getDefaultTrackTreadLogo());
                }
                return(brandedrecords.First().DealershipLogo);

            default:
                return(getDefaultTrackTreadLogo());
            }
        }
示例#3
0
        //public IEnumerable<QuoteReportStyleViewModel> getDealershipAvailableReports(int DealershipId)
        //{

        //}
        public string getDealershipStyleByHost(string host, InfotrakApplications InfotrakApp)
        {
            IEnumerable <DealershipBranding> brandedrecords;

            switch (InfotrakApp)
            {
            case InfotrakApplications.IdentityServer:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.IdentityHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultStyles.IdentityDefaultStyle);
                }
                return(brandedrecords.First().ApplicationStyle.IdentityCSSFile);

            case InfotrakApplications.UC:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.UCHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultStyles.UCDefaultStyle);
                }
                return(brandedrecords.First().ApplicationStyle.UCCSSFile);

            case InfotrakApplications.UCUI:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.UCUIHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultStyles.UCUIDefaultStyle);
                }
                return(brandedrecords.First().ApplicationStyle.UCUICSSFile);

            case InfotrakApplications.GET:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.GETHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultStyles.GETDefaultStyle);
                }
                return(brandedrecords.First().ApplicationStyle.GETCSSFile);

            case InfotrakApplications.GETUI:
                brandedrecords = _domainContext.DealershipBranding.Where(m => m.GETUIHost == host);
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultStyles.GETUIDefaultStyle);
                }
                return(brandedrecords.First().ApplicationStyle.GETUICSSFile);

            default:
                return(ApplicationDefaultStyles.DefaultStyle);
            }
        }
示例#4
0
        /// <summary>
        /// Returns the requested application based on the IdentityServer Host.
        /// Only must be called from Identity server to knows to which application should redirect
        /// </summary>
        /// <param name="identityHost"></param>
        /// <param name="InfotrakApp"></param>
        /// <returns></returns>
        public string getDealershipApplicationAddressByIdentityHost(InfotrakApplications InfotrakApp, string identityHost)
        {
            IEnumerable <DealershipBranding> brandedrecords = _domainContext.DealershipBranding.Where(m => m.IdentityHost == identityHost);

            switch (InfotrakApp)
            {
            case InfotrakApplications.UC:
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultURIs.UC);
                }
                return(brandedrecords.First().UCHost);

            case InfotrakApplications.UCUI:
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultURIs.UCUI);
                }
                return(brandedrecords.First().UCUIHost);

            case InfotrakApplications.GET:
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultURIs.GET);
                }
                return(brandedrecords.First().GETHost);

            case InfotrakApplications.GETUI:
                if (brandedrecords.Count() == 0)
                {
                    return(ApplicationDefaultURIs.GETUI);
                }
                return(brandedrecords.First().GETUIHost);

            default:
                return("/");
            }
        }