PartialMaterial.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Media.Media3D;
  7. using System.Windows.Media;
  8. namespace WpfApp1
  9. {
  10. public partial class Material
  11. {
  12. public string materialSupliers
  13. {
  14. get
  15. {
  16. string suppliers = "";
  17. List<MaterialSupplier> materialSupplier = Base.BD.MaterialSupplier.Where(x => x.MaterialID == ID).ToList();
  18. for(int i = 0; i < materialSupplier.Count; i++)
  19. {
  20. if(i == materialSupplier.Count - 1)
  21. {
  22. suppliers += materialSupplier[i].Supplier.Title;
  23. }
  24. else
  25. {
  26. suppliers += materialSupplier[i].Supplier.Title + ",";
  27. }
  28. }
  29. return suppliers;
  30. }
  31. }
  32. public SolidColorBrush ColorStr
  33. {
  34. get
  35. {
  36. if(CountinStock < MinCount)
  37. {
  38. SolidColorBrush minCount = (SolidColorBrush)new BrushConverter().ConvertFromString("#f19292");
  39. return minCount;
  40. }
  41. else if((CountinStock/MinCount)*100 > 300)
  42. {
  43. SolidColorBrush maxCount = (SolidColorBrush)new BrushConverter().ConvertFromString("#ffba01");
  44. return maxCount;
  45. }
  46. else
  47. {
  48. return Brushes.White;
  49. }
  50. }
  51. }
  52. }
  53. }