Product.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using MySqlConnector;
  7. using Dapper;
  8. using mysql_connector2.res;
  9. namespace mysql_connector2.res
  10. {
  11. public class Product
  12. {
  13. public decimal MinCostForAgent { get; set; }
  14. public int ID { get; set; }
  15. public required string Title { get; set; }
  16. public string? Image { get; set; }
  17. public int ProductTypeID { get; set; }
  18. public required string ProductTypeTitle { get; set; }
  19. public required string ArticleNumber { get; set; }
  20. public double? MaterialCost { get; set; }
  21. public string? MaterialString { get; set; }
  22. public int? LastMonthSaleQuantity { get; set; }
  23. public string BackgroundColor
  24. {
  25. get
  26. {
  27. if (LastMonthSaleQuantity == null || LastMonthSaleQuantity == 0) return "#ff97bb"; // белый
  28. return "#fff"; // розовый
  29. }
  30. }
  31. public Uri? ImageBitmap
  32. {
  33. get
  34. {
  35. var imageName = Environment.CurrentDirectory + (Image ?? "");
  36. return System.IO.File.Exists(imageName) ? new Uri(imageName) : null;
  37. }
  38. }
  39. }
  40. }