demo_trade/UI/Presenters/ProductPresenter.cs
2024-10-04 15:41:04 +03:00

37 lines
977 B
C#

using Avalonia.Media;
using Avalonia.Media.Imaging;
using demo_trade.Models;
using System.Threading.Tasks;
namespace demo_trade.UI.Presenters
{
public class ProductPresenter
{
public string ArticleNumber { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public decimal Cost { get; set; }
public short? DiscountAmount { get; set; }
public int? QuantityInStock { get; set; }
public string Image { get; set; }
public int? ProductMaxDiscount { get; set; }
public decimal? CostWithDiscount { get => Cost - (Cost * DiscountAmount / 100); }
public Manufacturer Manufacturer { get; set; }
public SolidColorBrush ColorBackgroundItem { get => DiscountAmount < 15 ?
new SolidColorBrush(Color.FromRgb(255, 255, 255))
:
new SolidColorBrush(Color.FromRgb(255, 245, 0));
}
}
}