using LeaRun.Application.Entity.AuthorizeManage; using LeaRun.Application.IService.AuthorizeManage; using LeaRun.Data.Repository; using LeaRun.Util.Extension; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LeaRun.Application.Service.AuthorizeManage { /// /// 版 本 6.1 /// Copyright (c) 2013-2016 上海力软信息技术有限公司 /// 创建人:陈彬彬 /// 日 期:2016.04.14 09:16 /// 描 述:系统表单实例 /// public class ModuleFormInstanceService : RepositoryFactory,IModuleFormInstanceService { #region 获取数据 /// /// 获取一个实体类 /// /// /// public ModuleFormInstanceEntity GetEntityByObjectId(string objectId) { try { var expression = LinqExtensions.True(); expression = expression.And(t => t.ObjectId.Equals(objectId)); return this.BaseRepository().FindEntity(expression); } catch { throw; } } #endregion #region 提交数据 /// /// 保存一个实体 /// /// /// /// public int SaveEntity(string keyValue, ModuleFormInstanceEntity entity) { try { if (string.IsNullOrEmpty(keyValue)) { entity.Create(); return this.BaseRepository().Insert(entity); } else { entity.Modify(keyValue); return this.BaseRepository().Update(entity); } } catch { throw; } } #endregion } }