using MadRunFabric.Common;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace MadRunFabric.Model
{
    /// <summary>
    /// 文件管理
    /// 资料管理 - 省三院
    /// </summary>
    [BsonIgnoreExtraElements]
    public class Pro_StudyMaterials_Info : IBaseModel<string>
    {
        /// <summary>
        /// id
        /// </summary>
        [Key]
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string id { get; set; }
        /// <summary>
        /// 学习资料标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 项目名称id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string projectid { get; set; }
        /// <summary>
        /// 学习资料内容
        /// </summary>
        public string content { get; set; }
        /// <summary>
        /// 附件（包括图片）
        /// </summary>
        public List<FileBaseModel> studymaterfile { get; set; } = null;
        /// <summary>
        /// 添加人
        /// </summary>
        public string createby { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime createtime
        {
            get
            {
                return _createtime.ToLocalTime();
            }
            set
            {
                _createtime = value.ToLocalTime();
            }
        }
        private DateTime _createtime = DateTime.Now.ToLocalTime();
        /// <summary>
        /// 是否删除(0正常-1删除)
        /// </summary>
        public int isdelete { get; set; } = 0;
        /// <summary>
        /// 删除人
        /// </summary>
        public string deleteby { get; set; }
        /// <summary>
        /// 删除日期
        /// </summary>
        public DateTime deletetime
        {
            get
            {
                return _deletetime.ToLocalTime();
            }
            set
            {
                _deletetime = value.ToLocalTime();
            }
        }
        private DateTime _deletetime;
    }
}
