using DeviceRepairAndOptimization.Models.Enum;
using System;

namespace DeviceRepairAndOptimization.Models
{
    /// <summary>
    /// 维修记录
    /// 对应数据库表名称：DriveMaintenanceLogs
    /// </summary>
    public class DriveMaintenanceLogs
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public int AutoID { get; set; }

        /// <summary>
        /// 设备编号
        /// </summary>
        public int EquipmentID { get; set; }

        /// <summary>
        /// 文档版本
        /// </summary>
        public int MaintenanceFormVersion { get; set; }

        /// <summary>
        /// 设备型号规格
        /// </summary>
        public string Specification { get; set; }

        /// <summary>
        /// 年份
        /// </summary>
        public int Year { get; set; }

        /// <summary>
        /// 一月
        /// </summary>
        public int Jan { get; set; }

        /// <summary>
        /// 二月
        /// </summary>
        public int Feb { get; set; }

        /// <summary>
        /// 三月
        /// </summary>
        public int Mar { get; set; }

        /// <summary>
        /// 四月
        /// </summary>
        public int Apr { get; set; }

        /// <summary>
        /// 五月
        /// </summary>
        public int May { get; set; }

        /// <summary>
        /// 六月
        /// </summary>
        public int Jun { get; set; }

        /// <summary>
        /// 七月
        /// </summary>
        public int Jul { get; set; }

        /// <summary>
        /// 八月
        /// </summary>
        public int Aug { get; set; }

        /// <summary>
        /// 九月
        /// </summary>
        public int Sep { get; set; }

        /// <summary>
        /// 十月
        /// </summary>
        public int Oct { get; set; }

        /// <summary>
        /// 十一月
        /// </summary>
        public int Nov { get; set; }

        /// <summary>
        /// 十二月
        /// </summary>
        public int Dec { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Comment { get; set; }

        /// <summary>
        /// 保养人
        /// </summary>
        public string MaintenancePerson { get; set; }

        /// <summary>
        /// 保养日期
        /// </summary>
        public DateTime MaintenanceDate { get; set; }

        /// <summary>
        /// 作者
        /// </summary>
        public string Author { get; set; }

        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime CreatDate { get; set; }

        /// <summary>
        /// 设置月份状态
        /// </summary>
        /// <param name="Month">月份 （1-12）</param>
        /// <param name="flag"></param>
        public void SetMaintenanceFlagValue(int Month, enumMaintenanceFlag flag)
        {
            switch (Month)
            {
                case 1:
                    Jan = (int)flag;
                    break;
                case 2:
                    Feb = (int)flag;
                    break;
                case 3:
                    Mar = (int)flag;
                    break;
                case 4:
                    Apr = (int)flag;
                    break;
                case 5:
                    May = (int)flag;
                    break;
                case 6:
                    Jun = (int)flag;
                    break;
                case 7:
                    Jul = (int)flag;
                    break;
                case 8:
                    Aug = (int)flag;
                    break;
                case 9:
                    Sep = (int)flag;
                    break;
                case 10:
                    Oct = (int)flag;
                    break;
                case 11:
                    Nov = (int)flag;
                    break;
                case 12:
                    Dec = (int)flag;
                    break;
                default:
                    break;
            }
        }
    }
}