public IEnumerable <ExtendFieldDto> GetExtendFields(int siteId) { ISite site = this.repo.GetSiteById(siteId); ExtendFieldDto dto; IEnumerable <IExtendField> extends = site.GetExtendManager().GetAllExtends(); foreach (IExtendField extend in extends) { dto = new ExtendFieldDto().CloneData(extend); dto.Id = extend.GetDomainId(); yield return(dto); } }
public int SaveExtendField(int siteId, ExtendFieldDto dto) { ISite site = this._resp.GetSiteById(siteId); if (site == null) { throw new Exception("站点不存在"); } IExtendField field = this._extendRep.CreateExtendField(dto.Id, dto.Name); field.CloneData(dto); return(site.GetExtendManager().SaveExtendField(field)); }
public Result SaveExtendField(int siteId, ExtendFieldDto dto) { ISite site = this.repo.GetSiteById(siteId); if (site == null) { throw new Exception("站点不存在"); } IExtendField field = this._extendRep.CreateExtendField(dto.Id, dto.Name); field.CloneData(dto); Error err = site.GetExtendManager().SaveExtendField(field); Result r = new Result(); if (err != null) { r.ErrCode = 1; r.ErrMsg = err.Message; } return(r); }