39 lines
1017 B
C#
Raw Normal View History

using System.ComponentModel;
namespace GasStation.Entities;
2024-11-13 23:20:06 +04:00
public class Supply
{
public int Id { get; private set; }
[Browsable(false)]
2024-11-13 23:20:06 +04:00
public int SupplierID { get; private set; }
[Browsable(false)]
2024-11-13 23:20:06 +04:00
public int ProductID { get; private set; }
[DisplayName("Имя поставщика")]
public string SupplierName { get; private set; } = string.Empty;
[DisplayName("Название товара")]
public string ProductName { get; private set; } = string.Empty;
[DisplayName("Количество товара")]
2024-12-02 14:38:24 +04:00
public int Count { get; private set; }
2024-11-13 23:20:06 +04:00
[DisplayName("Дата поставки")]
2024-12-02 14:38:24 +04:00
public DateTime SupplyDate { get; private set; }
2024-11-13 23:20:06 +04:00
2024-12-02 14:38:24 +04:00
public static Supply CreateSupply(int id, int supplierID, int productID, int count)
2024-11-13 23:20:06 +04:00
{
return new Supply
{
Id = id,
SupplierID = supplierID,
ProductID = productID,
2024-12-02 14:38:24 +04:00
Count = count,
SupplyDate = DateTime.Now
2024-11-13 23:20:06 +04:00
};
}
}