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. 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 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 Description { get; set; }
  24. public decimal Price { get; set; }
  25. public string Article { get; set; }
  26. public int ProductionPersonCount { get; set; }
  27. public int ProductionWorkshopNumber { get; set; }
  28. public string BackgroundColor
  29. {
  30. get
  31. {
  32. if (LastMonthSaleQuantity == null || LastMonthSaleQuantity == 0) return "#ff97bb"; // белый
  33. return "#fff"; // розовый
  34. }
  35. }
  36. public string? Image { get; set; }
  37. public Uri? ImageBitmap
  38. {
  39. get
  40. {
  41. var imageName = Environment.CurrentDirectory + (Image ?? "");
  42. return System.IO.File.Exists(imageName) ? new Uri(imageName) : null;
  43. }
  44. }
  45. }
  46. }