....
This commit is contained in:
26
Back/Data/Models/Order.cs
Normal file
26
Back/Data/Models/Order.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Back.Common.Enums;
|
||||
namespace Back.Data.Models
|
||||
{
|
||||
|
||||
public class Order
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int CompanyID { get; set; }
|
||||
public int UserID { get; set; }
|
||||
public StatusOrder Status { get; set; }
|
||||
public string DateCreate { get; set; }
|
||||
public string ApprovalDate { get; set; }
|
||||
public decimal PreDiscount { get { return OrderItems.Sum(s => s.Total); } }
|
||||
public decimal TDiscount { get; set; } = 0;
|
||||
public decimal TPrice { get { return OrderItems.Sum(s => s.Total) - TDiscount; } }
|
||||
|
||||
#region Navigation
|
||||
[ForeignKey("CompanyID")]
|
||||
public virtual Company Company { get; set; }
|
||||
[ForeignKey("UserID")]
|
||||
public virtual User User { get; set; }
|
||||
public virtual ICollection<OrderItem> OrderItems { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user