Пример #1
0
        /// <inheritdoc/>
        public ISite Update(ISite site, bool isReplace = true)
        {
            // Gets the site
            SiteInfo updateSite = SiteInfoProvider.GetSiteInfo(site.SiteName);

            if (updateSite != null)
            {
                if (isReplace)
                {
                    updateSite = site.UndoActLike();
                }
                else
                {
                    // Updates the site properties
                    updateSite.DisplayName = site.DisplayName;
                    updateSite.DomainName  = site.DomainName;
                    updateSite.SiteName    = site.SiteName;
                    updateSite.Status      = site.Status;
                }

                // Saves the modified site to the database
                SiteInfoProvider.SetSiteInfo(updateSite);
            }

            return(updateSite.ActLike <ISite>());
        }
Пример #2
0
        /// <inheritdoc/>
        public ISite Create(ISite site)
        {
            var siteInfo = new SiteInfo
            {
                DisplayName = site.DisplayName,
                SiteName    = site.SiteName,
                Status      = site.Status,
                DomainName  = site.DomainName,
            };

            SiteInfoProvider.SetSiteInfo(siteInfo);

            return(siteInfo.ActLike <ISite>());
        }