using System;
namespace ChangKeTec.Wms.Models
{
///
/// 自定义Decimal类型的精度属性
///
[AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
public sealed class DecimalPrecisionAttribute : Attribute
{
#region Field
private byte _precision = 18;
public byte _scale = 4;
#endregion
#region Construct
///
/// 自定义Decimal类型的精确度属性
///
/// precision
/// 精度(默认18)
/// scale
/// 小数位数(默认4)
public DecimalPrecisionAttribute(byte precision = 18, byte scale = 4)
{
Precision = precision;
Scale = scale;
}
#endregion
#region Property
///
/// 精确度(默认18)
///
public byte Precision
{
get { return this._precision; }
set { this._precision = value; }
}
///
/// 保留位数(默认4)
///
public byte Scale
{
get { return this._scale; }
set { this._scale = value; }
}
#endregion
}
}