2024-12-16 21:03:03 +04:00
|
|
|
|
using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing;
|
2024-12-19 08:47:36 +04:00
|
|
|
|
using System.ComponentModel;
|
2024-12-16 21:03:03 +04:00
|
|
|
|
using Unity;
|
|
|
|
|
|
|
|
|
|
namespace Publication.Entites;
|
2024-12-03 13:25:56 +04:00
|
|
|
|
|
|
|
|
|
public class PrintingHouses
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
public string Phone { get; set; }
|
|
|
|
|
public string Address { get; set; }
|
|
|
|
|
|
|
|
|
|
public int MaterialsId { get; set; }
|
|
|
|
|
|
2024-12-16 20:18:06 +04:00
|
|
|
|
public DateTime Date { get; set; }
|
|
|
|
|
|
2024-12-03 13:25:56 +04:00
|
|
|
|
public IEnumerable<PrintingHouseOrders> printingHouseOrder { get; set; } = [];
|
|
|
|
|
|
2024-12-19 08:47:36 +04:00
|
|
|
|
[DisplayName("Продукты")]
|
|
|
|
|
public string Product => printingHouseOrder != null ?
|
|
|
|
|
string.Join(", ", printingHouseOrder.Select(x => $"{x} {x.Count}")) : string.Empty;
|
|
|
|
|
|
2024-12-16 21:03:03 +04:00
|
|
|
|
public static PrintingHouses CreateEntity(int id, string title, string phone, string address,int materialsId, IEnumerable<PrintingHouseOrders> printingHouseOrders)
|
2024-12-03 13:25:56 +04:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return new PrintingHouses
|
|
|
|
|
{
|
|
|
|
|
Id = id,
|
|
|
|
|
Title = title,
|
|
|
|
|
Phone = phone,
|
|
|
|
|
Address = address,
|
2024-12-06 12:01:27 +04:00
|
|
|
|
MaterialsId=materialsId,
|
2024-12-16 21:03:03 +04:00
|
|
|
|
Date = DateTime.Now,
|
2024-12-03 13:25:56 +04:00
|
|
|
|
printingHouseOrder = printingHouseOrders
|
|
|
|
|
};
|
|
|
|
|
}
|
2024-12-16 21:03:03 +04:00
|
|
|
|
|
|
|
|
|
public static PrintingHouses CreateEntity(TempPrintingHouseOrders tempPrintingHouseOrders, IEnumerable<PrintingHouseOrders> _printingHouseOrders)
|
|
|
|
|
{
|
|
|
|
|
return new PrintingHouses
|
|
|
|
|
{
|
|
|
|
|
Id = tempPrintingHouseOrders.Id,
|
|
|
|
|
Title = tempPrintingHouseOrders.Title,
|
|
|
|
|
Phone = tempPrintingHouseOrders.Phone,
|
|
|
|
|
Address = tempPrintingHouseOrders.Address,
|
|
|
|
|
MaterialsId = tempPrintingHouseOrders.MaterialsId,
|
|
|
|
|
Date = tempPrintingHouseOrders.Date,
|
|
|
|
|
printingHouseOrder = _printingHouseOrders
|
|
|
|
|
};
|
|
|
|
|
}
|
2024-12-03 13:25:56 +04:00
|
|
|
|
}
|