yavsc/Yavsc/Models/Billing/CommandLine.cs

49 lines
1.0 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
8 years ago
using Newtonsoft.Json;
namespace Yavsc.Models.Billing
{
using Yavsc.Billing;
8 years ago
public class CommandLine : ICommandLine {
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
7 years ago
[Required,MaxLength(256)]
public string Name { get; set; }
8 years ago
[Required,MaxLength(512)]
public string Description { get; set; }
8 years ago
7 years ago
[Display(Name="Nombre")]
public int Count { get; set; } = 1;
8 years ago
[DisplayFormat(DataFormatString="{0:C}")]
public decimal UnitaryCost { get; set; }
8 years ago
public long EstimateId { get; set; }
8 years ago
[JsonIgnore,NotMapped,ForeignKey("EstimateId")]
virtual public Estimate Estimate { get; set; }
public string Currency
{
get;
set;
7 years ago
} = "EUR";
[NotMapped]
public string Reference {
get {
return "CL/"+this.Id;
}
}
}
7 years ago
}