예제 #1
0
        public int SaveLink(int siteId, SiteLinkDto dto)
        {
            ISite     site = this._resp.GetSiteById(siteId);
            ISiteLink link = null;

            if (dto.Id <= 0)
            {
                link = this._resp.CreateLink(site, 0, dto.Text);
            }
            else
            {
                link = site.LinkManager.GetLinkById(dto.Id);
            }

            link.Bind       = dto.Bind;
            link.ImgUrl     = dto.ImgUrl;
            link.OrderIndex = dto.OrderIndex;
            link.Pid        = dto.Pid;
            link.Target     = dto.Target;
            link.Text       = dto.Text;
            link.Type       = dto.Type;
            link.Uri        = dto.Uri;
            link.Visible    = dto.Visible;

            return(link.Save());
        }
예제 #2
0
        public int SaveLink(int siteId, SiteLinkDto dto)
        {
            ISite     site = this.repo.GetSiteById(siteId);
            ISiteLink link = null;

            if (dto.Id <= 0)
            {
                link = this.repo.CreateLink(site, 0, dto.Text);
            }
            else
            {
                link = site.GetLinkManager().GetLinkById(dto.Id);
            }

            link.Bind       = dto.Bind;
            link.ImgUrl     = dto.ImgUrl;
            link.SortNumber = dto.SortNumber;
            link.Pid        = dto.Pid;
            link.Target     = dto.Target;
            link.Text       = dto.Text;
            link.Type       = dto.Type;
            link.Uri        = dto.Uri;
            link.Visible    = dto.Visible;

            return(link.Save());
        }