예제 #1
0
        /// <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);
        }
예제 #2
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);
        }
예제 #3
0
파일: OwnerData.cs 프로젝트: x1987624/SNS
        /// <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);
        }
예제 #4
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;
 }