yavsc/Yavsc/Models/Billing/CommandLine.cs

48 lines
1 KiB
C#
Raw Normal View History

2016-05-17 18:22:18 +02:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
2016-10-23 01:31:09 +02:00
using Newtonsoft.Json;
2016-05-17 18:22:18 +02:00
2016-06-14 03:37:57 +02:00
namespace Yavsc.Models.Billing
2016-05-17 18:22:18 +02:00
{
2017-05-27 16:22:58 +02:00
using Yavsc.Billing;
2016-05-17 18:22:18 +02:00
2017-03-02 23:47:44 +01:00
public class CommandLine : ICommandLine {
2016-05-17 18:22:18 +02:00
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
2017-05-05 23:37:07 +02:00
2017-05-12 12:15:57 +02:00
[Required,MaxLength(256)]
public string Name { get; set; }
2016-10-23 01:31:09 +02:00
[Required,MaxLength(512)]
2016-09-17 03:41:31 +02:00
public string Description { get; set; }
2017-02-27 19:28:32 +01:00
2017-05-12 12:15:57 +02:00
[Display(Name="Nombre")]
public int Count { get; set; } = 1;
2017-02-22 22:58:02 +01:00
[DisplayFormat(DataFormatString="{0:C}")]
2016-05-17 18:22:18 +02:00
public decimal UnitaryCost { get; set; }
2016-10-23 01:31:09 +02:00
public long EstimateId { get; set; }
2017-05-05 23:37:07 +02:00
2016-10-23 01:31:09 +02:00
[JsonIgnore,NotMapped,ForeignKey("EstimateId")]
virtual public Estimate Estimate { get; set; }
2017-05-05 23:37:07 +02:00
public string Currency
{
get;
set;
2017-05-12 12:15:57 +02:00
} = "EUR";
[NotMapped]
public string Reference {
get {
return "CL/"+this.Id;
}
2017-05-05 23:37:07 +02:00
}
}
2016-05-17 18:22:18 +02:00
2017-05-12 12:15:57 +02:00
2016-05-17 18:22:18 +02:00
}