using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace RB_MES_API.Models
{
    /// <summary>
    /// 系统文件，包含各种参数定义
    /// </summary>
    public class SystemProfile
    {
        /// <summary>
        /// 自增ID，非主键
        /// </summary>
        public int FID { get; set; }
        /// <summary>
        /// 主键之一
        /// </summary>
        [Required]
        [DisplayName("模块分类")]
        public int FCategoryID { get; set; }    //来源于枚举 ModelGroup
        /// <summary>
        /// 主键之一
        /// </summary>
        [Required]
        [DisplayName("关键字")]
        public string FKey { get; set; } = string.Empty;
        /// <summary>
        /// 内容格式转换参考FFormatID，如果是子窗体，参数值需要在调用后再计算
        /// </summary>
        [DisplayName("参数值")]
        [StringLength(200)]
        public string FValue { get; set; } = string.Empty;
        /// <summary>
        /// 某些参数一经设置不能修改，或者部分由开发人员设计的不能被修改
        /// </summary>
        [DisplayName("是否只读")]
        public bool FReadonly { get; set; } = false;
        /// <summary>
        /// 一些便于用于使用的说明
        /// </summary>
        [DisplayName("参数/参数值描述")]
        public string FDescription { get; set; } = string.Empty;
        /// <summary>
        /// 对主键的翻译
        /// </summary>
        [DisplayName("参数名")]
        [StringLength(200)]
        public string FName { get; set; } = string.Empty;
        /// <summary>
        /// 显示分组
        /// </summary>
        [DisplayName("级次")]
        public int FLevel { get; set; }=1;
        /// <summary>
        /// 直接上级ID
        /// </summary>
        [DisplayName("上级ID")]
        public int FParentID { get; set; }=0;
        /// <summary>
        /// 决定展示时控件的逻辑
        /// </summary>
        [DisplayName("显示类型")]
        public int FFormatID { get; set; } = 1;     //来源于枚举 CellViewType
        /// <summary>
        /// 只有明细，FReadonly才可能为True
        /// </summary>
        [DisplayName("是否明细")]
        public bool FDetail { get; set; } = true;
    }
}
