DataDictionary.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. using System.Linq;
  7. using System.Runtime.CompilerServices;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace GDNXFD.Data
  11. {
  12. // CREATE TABLE "SA"."DATADICTIONARY"
  13. // ( "ID" NUMBER NOT NULL ENABLE,
  14. //"CATEGORY" VARCHAR2(50) NOT NULL ENABLE,
  15. //"CODE" VARCHAR2(50) NOT NULL ENABLE,
  16. //"NAME" VARCHAR2(50) NOT NULL ENABLE,
  17. //"ORDERNO" NUMBER(10,0) DEFAULT 0 NOT NULL ENABLE,
  18. //"ENABLED" NUMBER(1,0) DEFAULT 1 NOT NULL ENABLE
  19. // ) SEGMENT CREATION IMMEDIATE
  20. // COMMENT ON COLUMN "SA"."DATADICTIONARY"."CATEGORY" IS '类型';
  21. // COMMENT ON COLUMN "SA"."DATADICTIONARY"."CODE" IS '编码';
  22. // COMMENT ON COLUMN "SA"."DATADICTIONARY"."NAME" IS '名称';
  23. // COMMENT ON COLUMN "SA"."DATADICTIONARY"."ORDERNO" IS '顺序号';
  24. // COMMENT ON COLUMN "SA"."DATADICTIONARY"."ENABLED" IS '是否有效';
  25. [Table("DATADICTIONARY")]
  26. public class DictItem : INotifyPropertyChanged
  27. {
  28. private long _id;
  29. private string _category;
  30. private string _code;
  31. private string _name;
  32. private int _orderno;
  33. private bool _enabled;
  34. [Column("ID")]
  35. public long Id
  36. {
  37. get { return _id; }
  38. set
  39. {
  40. _id = value;
  41. RaisePropertyChanged();
  42. }
  43. }
  44. [Column("CATEGORY")]
  45. public string Category
  46. {
  47. get { return _category; }
  48. set
  49. {
  50. _category = value;
  51. RaisePropertyChanged();
  52. }
  53. }
  54. [Column("CODE")]
  55. public string Code
  56. {
  57. get { return _code; }
  58. set
  59. {
  60. _code = value;
  61. RaisePropertyChanged();
  62. }
  63. }
  64. [Column("NAME")]
  65. public string Name
  66. {
  67. get { return _name; }
  68. set
  69. {
  70. _name = value;
  71. RaisePropertyChanged();
  72. }
  73. }
  74. [Column("ORDERNO")]
  75. public int OrderNo
  76. {
  77. get { return _orderno; }
  78. set
  79. {
  80. _orderno = value;
  81. RaisePropertyChanged();
  82. }
  83. }
  84. [Column("ENABLED")]
  85. public bool Enabled
  86. {
  87. get { return _enabled; }
  88. set
  89. {
  90. _enabled = value;
  91. RaisePropertyChanged();
  92. }
  93. }
  94. /// <summary>
  95. /// Property changed event
  96. /// </summary>
  97. public event PropertyChangedEventHandler PropertyChanged;
  98. private void RaisePropertyChanged([CallerMemberName] string caller = "")
  99. {
  100. if (PropertyChanged != null)
  101. {
  102. PropertyChanged(this, new PropertyChangedEventArgs(caller));
  103. }
  104. }
  105. }
  106. }