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 sql_pagining.models;
  7. using Dapper;
  8. using MySqlConnector;
  9. namespace sql_pagining.models
  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 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 "#fff0f5"; // белый
  33. return "#ffafcc"; // розовый
  34. }
  35. }
  36. public Uri? ImageBitmap
  37. {
  38. get
  39. {
  40. var imageName = Environment.CurrentDirectory + (Image ?? "");
  41. return System.IO.File.Exists(imageName) ? new Uri(imageName) : null;
  42. }
  43. }
  44. }
  45. }