using IRaCIS.Core.Domain.Share;

namespace IRaCIS.Core.Application.Helper
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = false)]
    public class DictionaryTranslateAttribute : Attribute
    {

        public string DicParentCode { get; set; }

        public DicDataTypeEnum DataTypeEnum { get; set; }

        public CriterionType? CriterionType { get; set; }


        //是否翻译依赖其他属性
        public bool IsTranslateDenpendOtherProperty => !string.IsNullOrWhiteSpace(DependPropertyName);

        public string DependPropertyName { get; set; } = string.Empty;

        public string DependPropertyValueStr { get; set; } = string.Empty;

        // 普通翻译的字典
        public DictionaryTranslateAttribute(string dicParentCode)
        {
            DicParentCode = dicParentCode;

        }

        //针对不同的标准 翻译的字典不一样 
        public DictionaryTranslateAttribute(string dicParentCode, CriterionType criterionType)
        {
            DicParentCode = dicParentCode;

            CriterionType = criterionType;
        }

        //针对业务某个属性的值 不一样 用的翻译字典不一样

        public DictionaryTranslateAttribute(string dicParentCode, string dependPropertyName, string dependPropertyValueStr)
        {
            DicParentCode = dicParentCode;

            DependPropertyName = dependPropertyName;

            DependPropertyValueStr = dependPropertyValueStr;

        }

        public DictionaryTranslateAttribute(string dicParentCode, CriterionType criterionType, string dependPropertyName, string dependPropertyValueStr)
        {
            DicParentCode = dicParentCode;

            DependPropertyName = dependPropertyName;

            CriterionType = criterionType;

            DependPropertyValueStr = dependPropertyValueStr;

        }

    }

    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
    public class DateTimeTranaslateAttribute : Attribute
    {
        public string Formart { get; set; }

        public DateTimeTranaslateAttribute(string formart)
        {
            Formart = formart;

        }
    }
}
