demo20230512/Models/Paramemter/YearlyParameter.cs

51 lines
1.5 KiB
C#
Raw Normal View History

2023-05-12 10:20:28 +08:00
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
using Resources;
namespace Weee.Models.Paramemter
{
[Table("YearlyParameters")]
public class YearlyParameter : Parameter
{
public YearlyParameter()
{
CreateTime = DateTime.UtcNow;
}
public YearlyParameter(int year, decimal value )
{
Value = value;
Year = year;
CreateTime = DateTime.UtcNow;
IsHistory = false;
}
[Required]
[Display(Name = "Value", ResourceType = typeof(Resource))]
public override decimal Value { get; set; }
[Required]
[Display(Name = "StaticLabelGlobal_Years", ResourceType = typeof(Resource))]
public int Year { get; set; }
[Column(TypeName = "DateTime2")]
public DateTime CreateTime { get; set; }
[Display(Name = "StaticLabelGlobal_Description", ResourceType = typeof(Resource))]
public string Description { get; set; }
public bool IsHistory { get; set; }
[Required]
public int AreaID { get; set; }
[ForeignKey("AreaID")]
public virtual YearlyParameterArea Area { get; set; }
[Required]
public int TypeID { get; set; }
[ForeignKey("TypeID")]
public virtual YearlyParameterType Type { get; set; }
}
}