37 lines
1018 B
C#
37 lines
1018 B
C#
using System.Collections;
|
|
|
|
namespace GasStation.Entities;
|
|
|
|
public class Selling
|
|
{
|
|
public int Id { get; private set; }
|
|
|
|
public int GasmanId { get; private set; }
|
|
|
|
public IEnumerable<ProductSelling> ProdutcSellings { get; private set; } = [];
|
|
|
|
public DateTime SellingDateTime { get; private set; }
|
|
|
|
public static Selling CreateSelling(int id, int gasmanId, IEnumerable<ProductSelling> produtcSellings)
|
|
{
|
|
return new Selling
|
|
{
|
|
Id = id,
|
|
GasmanId = gasmanId,
|
|
SellingDateTime = DateTime.Now,
|
|
ProdutcSellings = produtcSellings
|
|
};
|
|
}
|
|
|
|
public static Selling CreateSelling(TempProductSelling tempProductSelling, IEnumerable<ProductSelling> produtcSellings)
|
|
{
|
|
return new Selling
|
|
{
|
|
Id = tempProductSelling.Id,
|
|
GasmanId = tempProductSelling.GasmanId,
|
|
SellingDateTime = tempProductSelling.SellingDateTime,
|
|
ProdutcSellings = produtcSellings
|
|
};
|
|
}
|
|
}
|