public int SaveSiteLink(int siteId, ISiteLink link) { if (link.GetDomainId() <= 0) { return(linkDal.AddSiteLink(siteId, link)); } return(linkDal.UpdateSiteLink(siteId, link)); }
public static SiteLinkDto ConvertFrom(ISiteLink link) { return(new SiteLinkDto { Bind = link.Bind, Id = link.GetDomainId(), ImgUrl = link.ImgUrl, SortNumber = link.SortNumber, Pid = link.Pid, Target = link.Target, Text = link.Text, Type = link.Type, Uri = link.Uri, Visible = link.Visible }); }
public int UpdateSiteLink(int siteId, ISiteLink link) { return(ExecuteNonQuery( NewQuery(DbSql.Link_UpdateSiteLink, Db.CreateParametersFromArray( new object[, ] { { "@siteId", siteId }, { "@pid", link.Pid }, { "@TypeId", link.Type }, { "@Text", link.Text }, { "@Uri", link.Uri }, { "@imgurl", link.ImgUrl }, { "@Target", link.Target }, { "@sortNumber", link.SortNumber }, { "@visible", link.Visible }, { "@LinkId", link.GetDomainId() }, { "@bind", link.Bind } })))); }