2024-12-23 16:41:52 +04:00
|
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
|
|
|
using ShoeStore.Entities.Enums;
|
2024-11-29 15:40:02 +04:00
|
|
|
|
using System;
|
2024-11-14 23:56:25 +04:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2024-12-23 16:41:52 +04:00
|
|
|
|
using Unity;
|
|
|
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
2024-11-14 23:56:25 +04:00
|
|
|
|
|
|
|
|
|
namespace ShoeStore.Entities;
|
|
|
|
|
|
|
|
|
|
public class Sale
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; private set; }
|
|
|
|
|
public DateTime DateOfSale { get; private set; }
|
2024-12-13 02:10:40 +04:00
|
|
|
|
public IEnumerable<ProductSale> Product
|
2024-11-14 23:56:25 +04:00
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
private set;
|
|
|
|
|
} = [];
|
|
|
|
|
|
2024-12-23 16:41:52 +04:00
|
|
|
|
public static Sale CreateOperation(int id, DateTime date, IEnumerable<ProductSale> product)
|
2024-11-14 23:56:25 +04:00
|
|
|
|
{
|
|
|
|
|
return new Sale
|
|
|
|
|
{
|
|
|
|
|
Id = id,
|
2024-12-21 21:15:47 +04:00
|
|
|
|
DateOfSale = date,
|
|
|
|
|
Product = product
|
2024-11-14 23:56:25 +04:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-23 16:41:52 +04:00
|
|
|
|
public static Sale CreateOperation(TempProductSale tempProductSale, IEnumerable<ProductSale> products)
|
|
|
|
|
{
|
|
|
|
|
return new Sale
|
|
|
|
|
{
|
|
|
|
|
Id = tempProductSale.Id,
|
|
|
|
|
DateOfSale = tempProductSale.DateOfSale,
|
|
|
|
|
Product = products
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-14 23:56:25 +04:00
|
|
|
|
}
|