32 lines
858 B
C#
32 lines
858 B
C#
using GasStation.Entities.Enums;
|
|
using System.ComponentModel;
|
|
|
|
namespace GasStation.Entities;
|
|
|
|
public class Product
|
|
{
|
|
public int Id { get; private set; }
|
|
|
|
[DisplayName("Стоимость товара")]
|
|
public int ProductCost { get; private set; }
|
|
|
|
[DisplayName("Тип товара")]
|
|
public ProductType ProductType { get; private set; }
|
|
|
|
[DisplayName("Название товара")]
|
|
public string ProductName { get; private set; } = string.Empty;
|
|
|
|
public string FullName => $"{ProductType} {ProductName}";
|
|
|
|
public static Product CreateProduct(int id, string productName, int productCost, ProductType productType)
|
|
{
|
|
return new Product
|
|
{
|
|
Id = id,
|
|
ProductName = productName,
|
|
ProductCost = productCost,
|
|
ProductType = productType
|
|
};
|
|
}
|
|
}
|