Product.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. namespace WebApplication1.models
  2. {
  3. public class Product
  4. {
  5. public decimal MinCostForAgent { get; set; }
  6. public int ID { get; set; }
  7. public required string Title { get; set; }
  8. public string? Image { get; set; }
  9. public int ProductTypeID { get; set; }
  10. public string? ProductTypeTitle { get; set; }
  11. public required string ArticleNumber { get; set; }
  12. public double? MaterialCost { get; set; }
  13. public string? MaterialString { get; set; }
  14. public int? LastMonthSaleQuantity { get; set; }
  15. public string? Description { get; set; }
  16. public decimal? Price { get; set; }
  17. public string? Article { get; set; }
  18. public int? ProductionPersonCount { get; set; }
  19. public int ProductionWorkshopNumber { get; set; }
  20. public string? BackgroundColor
  21. {
  22. get
  23. {
  24. if (LastMonthSaleQuantity == null || LastMonthSaleQuantity == 0) return "#fff0f5"; // белый
  25. return "#ffafcc"; // розовый
  26. }
  27. }
  28. public Uri? ImageBitmap
  29. {
  30. get
  31. {
  32. var imageName = Environment.CurrentDirectory + (Image ?? "");
  33. return System.IO.File.Exists(imageName) ? new Uri(imageName) : null;
  34. }
  35. }
  36. }
  37. }