Product.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace wpf_connection3.model
  7. {
  8. public class Product
  9. {
  10. public int ID { get; set; }
  11. public string Title { get; set; }
  12. public string? Image { get; set; }
  13. public int ProductTypeID { get; set; }
  14. public string ProductTypeTitle { get; set; }
  15. public string ArticleNumber { get; set; }
  16. public double? MaterialCost { get; set; }
  17. public string? MaterialString { get; set; }
  18. public string Description { get; set; }
  19. public Uri? ImageBitmap
  20. {
  21. get
  22. {
  23. var imageName = Environment.CurrentDirectory + (Image ?? "");
  24. return System.IO.File.Exists(imageName) ? new Uri(imageName) : null;
  25. }
  26. }
  27. public int? LastMonthSaleQuantity { get; set; }
  28. public int ProductionPersonCount { get; set; }
  29. public int ProductionWorkshopNumber { get; set; }
  30. public decimal MinCostForAgent { get; set; }
  31. public string BackgroundColor
  32. {
  33. get
  34. {
  35. // возвращаем цвет, в зависимости от количества продаж
  36. if (LastMonthSaleQuantity == null || LastMonthSaleQuantity == 0) return "#f56c51"; // не белый
  37. return "#bdffbd"; // не розовый
  38. }
  39. }
  40. }
  41. }