protected void SaveDetailEntities(List <DetailObjectInfo> detailList) { if (detailList == null) { return; } foreach (var detailInfo in detailList) { IDataAccessBase da = EntityFactory.GetEntityDataAccessByName(detailInfo.EntityName, detailInfo.AdditionalDataKey); da.AutoSave = false; if (detailInfo.FnName == RuleFunctionSEnum.Insert) { da.Insert(detailInfo.EntitySet, new InsertParameters()); } else if (detailInfo.FnName == RuleFunctionSEnum.Update) { da.Update(detailInfo.EntitySet, new UpdateParameters()); } else if (detailInfo.FnName == RuleFunctionSEnum.Delete) { da.Delete(detailInfo.EntitySet, new DeleteParameters()); } else { throw new Exception("Function " + detailInfo.FnName + " is not defined in DataAccessLayer"); } } }
/// <summary> /// 添加菜单 /// </summary> /// <param name="menuModel"></param> /// <returns></returns> public bool AddMenu(MenuModel menuModel) { return(_dbContext.Insert(menuModel)); }
/// <summary> /// 添加权限值 /// </summary> /// <param name="permissions"></param> /// <returns></returns> public bool AddPermissions(PermissionsModel permissions) { return(_dbContext.Insert(permissions)); }