product.cs 915 B

12345678910111213141516171819202122232425262728293031
  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 int ID { get; set; }
  14. public required string Title { get; set; }
  15. public string? Image { get; set; }
  16. public int ProductTypeID { get; set; }
  17. public required string ProductTypeTitle { get; set; }
  18. public required string ArticleNumber { get; set; }
  19. public double? MaterialCost { get; set; }
  20. public string? MaterialString { get; set; }
  21. public Uri? ImageBitmap
  22. {
  23. get
  24. {
  25. var imageName = Environment.CurrentDirectory + (Image ?? "");
  26. return System.IO.File.Exists(imageName) ? new Uri(imageName) : null;
  27. }
  28. }
  29. }
  30. }