示例#1
0
        public int UpdateSite(ISite ist)
        {
            CmsSiteEntity site = ist.Get();
            IDictionary <string, Object> data = new Dictionary <string, Object>();

            data.Add("@name", site.Name);
            data.Add("@appName", site.AppPath);
            data.Add("@domain", site.Domain);
            data.Add("@location", site.Location);
            data.Add("@tpl", site.Tpl);
            data.Add("@language", site.Language);
            data.Add("@note", site.Note);
            data.Add("@seoTitle", site.SeoTitle);
            data.Add("@seoKeywords", site.SeoKeywords);
            data.Add("@seoDescription", site.SeoDescription);
            data.Add("@state", site.State);
            data.Add("@proTel", site.ProTel);
            data.Add("@proPhone", site.ProPhone);
            data.Add("@proFax", site.ProFax);
            data.Add("@proAddress", site.ProAddress);
            data.Add("@proEmail", site.ProEmail);
            data.Add("@proIm", site.ProIm);
            data.Add("@proPost", site.ProPost);
            data.Add("@proNotice", site.ProNotice);
            data.Add("@proSlogan", site.ProSlogan);
            data.Add("@siteId", site.SiteId);
            return(base.ExecuteNonQuery(base.NewQuery(DbSql.SiteEditSite, base.Db.GetDialect().ParseParameters(data))));
        }
示例#2
0
        public int CreateSite(ISite ist)
        {
            CmsSiteEntity site = ist.Get();
            IDictionary <string, Object> data = new Dictionary <string, Object>();

            data.Add("@name", site.Name);
            data.Add("@appName", site.AppPath);
            data.Add("@domain", site.Domain);
            data.Add("@location", site.Location);
            data.Add("@tpl", site.Tpl);
            data.Add("@language", site.Language);
            data.Add("@note", site.Note);
            data.Add("@seoTitle", site.SeoTitle);
            data.Add("@seoKeywords", site.SeoKeywords);
            data.Add("@seoDescription", site.SeoDescription);
            data.Add("@state", site.State);
            data.Add("@proTel", site.ProTel);
            data.Add("@proPhone", site.ProPhone);
            data.Add("@proFax", site.ProFax);
            data.Add("@proAddress", site.ProAddress);
            data.Add("@proEmail", site.ProEmail);
            data.Add("@proIm", site.ProIm);
            data.Add("@proPost", site.ProPost);
            data.Add("@proNotice", site.ProNotice);
            data.Add("@proSlogan", site.ProSlogan);
            base.ExecuteNonQuery(base.CreateQuery(DbSql.SiteCreateSite, data));
            return(int.Parse(base.ExecuteScalar(base.NewQuery(
                                                    "SELECT MAX(site_id) FROM $PREFIX_site", null)).ToString()));
        }
示例#3
0
        private RelatedLinkDto ConvertToLinkDto(int siteId, IContentLink link)
        {
            ISite        site      = this._siteRep.GetSiteById(link.RelatedSiteId);
            IBaseContent content   = this.GetContent(site.GetAggregaterootId(), ContentTypeIndent.Archive.ToString().ToLower(), link.RelatedContentId);
            String       thumbnail = null;
            IArchive     archive   = content as IArchive;

            if (archive != null)
            {
                thumbnail = archive.Get().Thumbnail;
            }

            return(new RelatedLinkDto
            {
                Id = link.Id,
                Enabled = link.Enabled,
                ContentId = link.ContentId,
                ContentType = link.ContentType,
                RelatedSiteId = link.RelatedSiteId,
                RelatedSiteName = site.Get().Name,
                RelatedContentId = link.RelatedContentId,
                RelatedIndent = link.RelatedIndent,
                Title = archive.Get().Title,
                Url = site.FullDomain + archive.Get().Path,
                Thumbnail = thumbnail,
                IndentName = ContentUtil.GetRelatedIndentName(link.RelatedIndent).Name,
            });
        }
示例#4
0
        public static ISite CopyTo(SiteDto dto, ISite ist)
        {
            CmsSiteEntity site = ist.Get();

            site.Name           = dto.Name;
            site.ProAddress     = dto.ProAddress;
            site.AppName        = dto.DirName.Trim();
            site.Domain         = dto.Domain.Trim();
            site.Location       = dto.Location.Trim();
            site.ProEmail       = dto.ProEmail;
            site.ProFax         = dto.ProFax.Trim();
            site.Language       = (int)dto.Language;
            site.ProPost        = dto.ProPost.Trim();
            site.Note           = dto.Note.Trim();
            site.ProNotice      = dto.ProNotice.Trim();
            site.ProPhone       = dto.ProPhone.Trim();
            site.ProIm          = dto.ProIm;
            site.SeoDescription = dto.SeoDescription;
            site.SeoKeywords    = dto.SeoKeywords;
            site.SeoTitle       = dto.SeoTitle;
            site.ProSlogan      = dto.ProSlogan;
            site.State          = (int)dto.State;
            site.ProTel         = dto.ProTel;
            site.Tpl            = dto.Tpl;
            return(ist);
        }
示例#5
0
        /// <summary>
        /// 从站点领域对象转换成为数据传输对象
        /// </summary>
        /// <param name="site"></param>
        /// <returns></returns>
        public static SiteDto ConvertFromSite(ISite ist)
        {
            CmsSiteEntity site = ist.Get();

            return(new SiteDto
            {
                ProAddress = site.ProAddress,
                DirName = site.AppName,
                Domain = site.Domain,
                FullDomain = ist.FullDomain,
                Location = site.Location,
                ProEmail = site.ProEmail,
                ProFax = site.ProFax,
                Language = ist.Language(),
                ProPost = site.ProPost,
                Name = site.Name,
                Note = site.Note,
                ProNotice = site.ProNotice,
                ProPhone = site.ProPhone,
                ProIm = site.ProIm,
                RunType = (int)ist.RunType(),
                SeoDescription = site.SeoDescription,
                SeoKeywords = site.SeoKeywords,
                SeoTitle = site.SeoTitle,
                SiteId = site.SiteId,
                ProSlogan = site.ProSlogan,
                State = ist.State(),
                ProTel = site.ProTel,
                Tpl = site.Tpl
            });
        }
        public IActionResult Detail(int id)
        {
            var site = _site.Get(id);

            var model = new SiteDetailModel
            {
                Id       = site.Id,
                Name     = site.Name,
                ImageUrl = site.ImageUrl
            };

            return(View(model));
        }