public int SaveSite(ISite site) { var siteId = site.GetAggregateRootId(); if (site.GetAggregateRootId() <= 0) { siteId = siteDal.CreateSite(site); if (siteId <= 0) { throw new ArgumentException("创建站点失败"); } } else { if (siteDal.UpdateSite(site) != 1) { throw new ArgumentException("站点不存在,保存失败"); } } //清理缓存 RepositoryDataCache._siteDict = null; RepositoryDataCache._categories = null; return(siteId); }
private void ItrCloneCate(ISite toSite, ICategory fromCate, int parentCateId, bool includeExtend, bool includeTemplateBind) { var newCategory = toSite.GetCategory(parentCateId); foreach (var cate in fromCate.NextLevelChildren) { var r = CloneCategoryDetails(toSite.GetAggregateRootId(), cate, newCategory.GetDomainId(), includeExtend, includeTemplateBind); var mp = r.Data as IDictionary <String, String>; var catId = Convert.ToInt32(mp["CategoryId"]); ItrCloneCate(toSite, cate, catId, includeExtend, includeTemplateBind); } }
public bool DeleteLink(int linkId) { return(_siteRep.DeleteSiteLink(_site.GetAggregateRootId(), linkId)); }
public int Save() { return(_siteRep.SaveSiteLink(_site.GetAggregateRootId(), this)); }