/// <summary> /// 获取DataKey对应的长整形 /// </summary> /// <param name="ownerId">用户Id</param> /// <param name="dataKey">DataKey</param> /// <returns>dataKey不存在时返回0</returns> public long Get(long ownerId, string dataKey) { OwnerData ownerData = ownerDataRepository.Get(ownerId, tenantTypeId, dataKey); if (ownerData == null) { return(default(long)); } return(ownerData.LongValue > 0 ? ownerData.LongValue : 0); }
/// <summary> /// 获取DataKey对应的Decimal /// </summary> /// <param name="ownerId">用户Id</param> /// <param name="dataKey">DataKey</param> /// <returns>dataKey不存在时返回0</returns> public decimal GetDecimal(long ownerId, string dataKey) { OwnerData ownerData = ownerDataRepository.Get(ownerId, tenantTypeId, dataKey); if (ownerData == null) { return(default(decimal)); } return(ownerData.DecimalValue > 0 ? ownerData.DecimalValue : 0); }
/// <summary> /// 新建实体时使用 /// </summary> public static OwnerData New() { OwnerData applicationData = new OwnerData() { OwnerId = 0, TenantTypeId = string.Empty, Datakey = string.Empty, LongValue = 0, DecimalValue = 0, StringValue = string.Empty }; return(applicationData); }
/// <summary> /// 新建实体时使用 /// </summary> public static OwnerData New() { OwnerData applicationData = new OwnerData() { OwnerId = 0, TenantTypeId = string.Empty, Datakey = string.Empty, LongValue = 0, DecimalValue = 0, StringValue = string.Empty }; return applicationData; }