Esempio n. 1
0
        /// <summary>
        /// AsLink
        /// </summary>
        /// <returns></returns>
        public LinkEntity AsLink()
        {
            LinkEntity link = null;

            if (this.LinkId > 0)
            {
                link = new LinkService().Get(this.LinkId);
            }
            else
            {
                link = LinkEntity.New();
            }

            if (string.IsNullOrEmpty(this.LinkName))
            {
                link.LinkName = this.LinkNameForSite;
            }
            else
            {
                link.LinkName = this.LinkName;
            }

            link.LinkUrl = this.LinkUrl;

            if (this.ImageUrl != null)
            {
                link.ImageUrl = this.ImageUrl;
            }
            else
            {
                link.ImageUrl = string.Empty;
            }

            if (this.Description != null)
            {
                link.Description = this.Description;
            }
            link.LinkType  = this.LinkType;
            link.IsEnabled = this.IsEnabled;

            return(link);
        }
Esempio n. 2
0
        /// <summary>
        /// AsLink
        /// </summary>
        /// <returns></returns>
        public LinkEntity AsLink()
        {
            LinkEntity link = null;
            if (this.LinkId > 0)
            {
                link = new LinkService().Get(this.LinkId);
            }
            else
            {
                link = LinkEntity.New();
            }

            if (string.IsNullOrEmpty(this.LinkName))
            {
                link.LinkName = this.LinkNameForSite;
            }
            else
            {
                link.LinkName = this.LinkName;
            }

            link.LinkUrl = this.LinkUrl;

            if (this.ImageUrl != null)
            {
                link.ImageUrl = this.ImageUrl;
            }
            else
            {
                link.ImageUrl = string.Empty;
            }

            if (this.Description != null)
            {
                link.Description = this.Description;
            }
            link.LinkType = this.LinkType;
            link.IsEnabled = this.IsEnabled;

            return link;
        }