demo20230512/Models/Paramemter/NonYearlyParameter.cs
2023-05-12 10:20:28 +08:00

42 lines
1.3 KiB
C#

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("NonYearlyParameters")]
public class NonYearlyParameter : Parameter
{
public NonYearlyParameter()
{
CreateTime = DateTime.UtcNow;
}
public NonYearlyParameter(decimal value)
{
Value = value;
CreateTime = DateTime.UtcNow;
IsHistory = false;
}
[Display(Name = "StaticLabelGlobal_Description", ResourceType = typeof(Resource))]
public string Description { get; set; }
[Required(ErrorMessageResourceType = typeof(Resource),
ErrorMessageResourceName = "RequiredMessage")]
[Display(Name = "Value", ResourceType = typeof(Resource))]
[DisplayFormat(DataFormatString = "{0:0.000000}",ApplyFormatInEditMode=true)]
public override decimal Value { get; set; }
public bool IsHistory { get; set; }
[Column(TypeName = "DateTime2")]
public DateTime CreateTime { get; set; }
[Required]
public int TypeID { get; set; }
[ForeignKey("TypeID")]
public virtual NonYearlyParameterType Type { get; set; }
}
}