Partial.cs 824 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Lopushok
  7. {
  8. public partial class Product
  9. {
  10. public decimal Cost
  11. {
  12. get
  13. {
  14. return ProductMaterial.Where(x=>x.ProductID==ID).Sum(x=>x.Material.Cost);
  15. }
  16. }
  17. public string ImagePath
  18. {
  19. get
  20. {
  21. string imagePath = string.Empty;
  22. if (Image==string.Empty)
  23. {
  24. imagePath ="picture.png";
  25. }
  26. else if (Image!=string.Empty)
  27. {
  28. imagePath = Environment.CurrentDirectory + Image;
  29. }
  30. return imagePath;
  31. }
  32. }
  33. }
  34. }