44 lines
1.0 KiB
C#
44 lines
1.0 KiB
C#
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
using ShoeStore.Entities.Enums;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Unity;
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
namespace ShoeStore.Entities;
|
|
|
|
public class Sale
|
|
{
|
|
public int Id { get; private set; }
|
|
public DateTime DateOfSale { get; private set; }
|
|
public IEnumerable<ProductSale> Product
|
|
{
|
|
get;
|
|
private set;
|
|
} = [];
|
|
|
|
public static Sale CreateOperation(int id, DateTime date, IEnumerable<ProductSale> product)
|
|
{
|
|
return new Sale
|
|
{
|
|
Id = id,
|
|
DateOfSale = date,
|
|
Product = product
|
|
};
|
|
}
|
|
|
|
public static Sale CreateOperation(TempProductSale tempProductSale, IEnumerable<ProductSale> products)
|
|
{
|
|
return new Sale
|
|
{
|
|
Id = tempProductSale.Id,
|
|
DateOfSale = tempProductSale.DateOfSale,
|
|
Product = products
|
|
};
|
|
}
|
|
|
|
}
|