70 lines
2.7 KiB
C#
70 lines
2.7 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using AyCode.Interfaces.Entities;
|
|
using AyCode.Interfaces.TimeStampInfo;
|
|
using TIAM.Entities.Addresses;
|
|
|
|
namespace TIAM.Entities.Transfers
|
|
{
|
|
[Table("TransferDestination")]
|
|
public class TransferDestination : IEntityGuid, ITransfeDestinationPrices, ITimeStampInfo //LocationBase
|
|
{
|
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid AddressId { get; set; }
|
|
[ForeignKey(nameof(AddressId))]
|
|
public virtual Address Address { get; set; }
|
|
|
|
public Guid? ProductId { get; set; }
|
|
//public virtual List<Product> Products { get; set; }
|
|
//public virtual List<TransferDestinationToProduct> TransferDestinationToProducts { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
public string Description { get; set; }
|
|
|
|
public double Price { get; set; }
|
|
public double? Price2 { get; set; }
|
|
public double? Price3 { get; set; }
|
|
|
|
public double ProductCommis { get;set; }
|
|
public double ExtraPrice { get; set; }
|
|
///// <summary>
|
|
///// Kihajtás v. behajtás az ExtraPrice! Ha null, akkor mindkettő...
|
|
///// </summary>
|
|
//public TransferExtraPriceType ExtraPriceType { get; set; }
|
|
|
|
//TEMPORARY!!!
|
|
public string? AddressString { get; set; }
|
|
|
|
public DateTime Created { get; set; }
|
|
public DateTime Modified { get; set; }
|
|
|
|
public TransferDestination() { }
|
|
public TransferDestination(string addressString) : this(Guid.NewGuid(), addressString) { }
|
|
//public TransferDestination(Guid id, double latitude, double longitude, string address) : base(id, latitude, longitude, address) { }
|
|
|
|
public TransferDestination(Guid id, string addressString)
|
|
{
|
|
Id = id;
|
|
AddressString = addressString;
|
|
}
|
|
public TransferDestination(Guid id, string name, string addressString) : this(id, addressString)
|
|
{
|
|
Name = name;
|
|
}
|
|
|
|
public TransferDestination(Guid id, string name, string description, string addressString) : this(id, name, addressString)
|
|
{
|
|
Description = description;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{nameof(Id)}: {Id}; {nameof(AddressId)}: {AddressId}; {nameof(Name)}: {Name}; {nameof(Description)}: {Description}; {nameof(Price)}: {Price}; " +
|
|
$"{nameof(Price2)}: {Price2}; {nameof(Price3)}: {Price3}; {nameof(ProductCommis)}: {ProductCommis}; {nameof(ExtraPrice)}: {ExtraPrice}; {nameof(AddressString)}: {AddressString};";
|
|
}
|
|
}
|
|
|
|
} |