CompItem.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using MeterVision.db;
  2. using MeterVision.Util;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace MeterVision.model
  10. {
  11. public class CompItem : INotifyPropertyChanged
  12. {
  13. public event PropertyChangedEventHandler PropertyChanged;
  14. protected virtual void OnPropertyChanged(string propertyName)
  15. {
  16. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  17. }
  18. private int _index;
  19. public int Index
  20. {
  21. get => _index;
  22. set
  23. {
  24. if (_index != value)
  25. {
  26. _index = value;
  27. OnPropertyChanged(nameof(Index));
  28. }
  29. }
  30. }
  31. public string CompId { get; set; }
  32. public string CreateTime { get; set; }
  33. public string CreateTimeName
  34. {
  35. get => ThisApp.ConvertDateFormat(CreateTime);
  36. }
  37. public string StandId { get; set; }
  38. public string StandName { get; set; }
  39. public int StandCount { get; set; }
  40. public string NPatchId { get; set; }
  41. public string NPatchName { get; set; }
  42. public string NPatchTime { get; set; }
  43. public string NPatchTimeName
  44. {
  45. get => ThisApp.ConvertDateFormat(NPatchTime);
  46. }
  47. public int NPatchDetailCount { get; set; }
  48. public int NPatchEqualCount { get; set; }
  49. public float NPatchEqualRate
  50. {
  51. get => (float)NPatchEqualCount / NPatchDetailCount;
  52. }
  53. public string OPatchId { get; set; }
  54. public string OPatchName { get; set; }
  55. public string OPatchTime { get; set; }
  56. public string OPatchTimeName
  57. {
  58. get => ThisApp.ConvertDateFormat(OPatchTime);
  59. }
  60. public int OPatchDetailCount { get; set; }
  61. public int OPatchEqualCount { get; set; }
  62. public float OPatchEqualRate
  63. {
  64. get => (float)OPatchEqualCount / OPatchDetailCount;
  65. }
  66. public CompItem()
  67. {
  68. }
  69. public CompItem(VComp vComp)
  70. {
  71. ObjectHelper.CopyMatchingFields(vComp, this);
  72. }
  73. //----------------------------------------------------------------------
  74. }
  75. }