Product.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. using System.Windows;
  10. namespace mysql_connector2.res
  11. {
  12. public class Product
  13. {
  14. public decimal MinCostForAgent { get; set; }
  15. public int ID { get; set; }
  16. public required string Title { get; set; }
  17. public int ProductTypeID { get; set; }
  18. public required string ProductTypeTitle { get; set; }
  19. public int? LastMonthSaleQuantity { get; set; }
  20. public string Description { get; set; }
  21. public decimal Price { get; set; }
  22. public string Article { get; set; }
  23. public int ProductionPersonCount { get; set; }
  24. public Visibility DeleteProductVisibly { get; set; } = Visibility.Collapsed;
  25. public int ProductionWorkshopNumber { get; set; }
  26. public double? MaterialCost { get; set; }
  27. public string? MaterialString { get; set; }
  28. public required string ArticleNumber { get; set; }
  29. public string BackgroundColor
  30. {
  31. get
  32. {
  33. if (LastMonthSaleQuantity == null || LastMonthSaleQuantity == 0) return "#ff97bb"; // белый
  34. return "#fff"; // розовый
  35. }
  36. }
  37. public string? Image { get; set; }
  38. public Uri? ImageBitmap
  39. {
  40. get
  41. {
  42. var imageName = Environment.CurrentDirectory + (Image ?? "");
  43. return System.IO.File.Exists(imageName) ? new Uri(imageName) : null;
  44. }
  45. }
  46. }
  47. }