AppNoticeProvicer.pas 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. unit AppNoticeProvicer;
  2. interface
  3. uses
  4. System.Classes, InterfaceDataProvider, mybean.core.objects, BaseDataProvider;
  5. type
  6. TAppNoticeProvider = class(TBaseDataProvider, IAppNoticeDateProvider)
  7. public
  8. function FindOne (ID: Integer): IInterface; stdcall;
  9. function FindAll(): IInterfaceList; stdcall;
  10. procedure Delete(AValue: IInterface); stdcall;
  11. procedure Update(AValue: IInterface); stdcall;
  12. procedure Insert(AValue: IInterface); overload; stdcall;
  13. procedure Insert(AValues: IInterfaceList); overload; stdcall;
  14. end;
  15. TAppNotice = class(TInterfacedObject, IAppNotice)
  16. private
  17. FID,
  18. FContent,
  19. FTitle,
  20. FURL: AnsiString;
  21. public
  22. function GetContent: AnsiString; stdcall;
  23. function GetID: AnsiString; stdcall;
  24. function GetTitle: AnsiString; stdcall;
  25. function GetURL: AnsiString; stdcall;
  26. function GetLoginName: AnsiString; stdcall;
  27. procedure SetLoginName(const Value: AnsiString); stdcall;
  28. procedure SetContent(const Value: AnsiString); stdcall;
  29. procedure SetID(const Value: AnsiString); stdcall;
  30. procedure SetTitle(const Value: AnsiString); stdcall;
  31. procedure SetURL(const Value: AnsiString); stdcall;
  32. property ID: AnsiString read GetID write SetID;
  33. property Content: AnsiString read GetContent write SetContent;
  34. property Title: AnsiString read GetTitle write SetTitle;
  35. property URL: AnsiString read GetURL write SetURL;
  36. end;
  37. implementation
  38. const
  39. APP_NOTICES_TABLE_NAME: string = 'AppNotices';
  40. APP_NOTICES_CREATE_TABLE: string = 'CREATE TABLE AppNotices('+
  41. 'LoginName string(50), ' +
  42. 'DisplayName string(50), ' +
  43. 'ServerID string(50), ' +
  44. 'Version Integer, ' +
  45. 'Sex byte)';
  46. APP_NOTICE_INSERT: string =
  47. 'Insert into AppNotices(LoginName, DisplayName, ServerID, Version, Sex) ' +
  48. 'Values(:LoginName, :DisplayName, :ServerID, :Version, :Sex)';
  49. APP_NOTICE_UPDATE: string = 'Update AppNotices Set DisplayName = :DisplayName, ' +
  50. 'Version = :Version, ' +
  51. 'Sex = :Sex, ' +
  52. 'Where LoginName = :LoginName and ServerID = :ServerID';
  53. APP_NOTICE_DELETE: string = 'Delete from AppNotices where LoginName = :LoginName and ServerID = :ServerID';
  54. APP_NOTICE_SELETE_ONE: string = 'Selete LoginName, DisplayName, ServerID, Version, Sex From AppNotices ' +
  55. 'Where LoginName = :LoginName and ServerID = :ServerID';
  56. APP_NOTICE_SELETE_ALL: string = 'Selete LoginName, DisplayName, ServerID, Version, Sex From AppNotices ' +
  57. 'Where ServerID = :ServerID';
  58. { TAppNoticeProvider }
  59. procedure TAppNoticeProvider.Delete(AValue: IInterface);
  60. var
  61. ANotice: IAppNotice;
  62. begin
  63. // if (AValue = nil)
  64. // or (AValue.QueryInterface(IAppNotice, ANotice) <> S_OK)
  65. // or (Connection = nil) then
  66. // Exit;
  67. end;
  68. function TAppNoticeProvider.FindAll: IInterfaceList;
  69. begin
  70. end;
  71. function TAppNoticeProvider.FindOne(ID: Integer): IInterface;
  72. begin
  73. end;
  74. procedure TAppNoticeProvider.Insert(AValues: IInterfaceList);
  75. begin
  76. end;
  77. procedure TAppNoticeProvider.Insert(AValue: IInterface);
  78. var
  79. ANotice: IAppNotice;
  80. begin
  81. // if (AValue = nil)
  82. // or (AValue.QueryInterface(IAppNotice, ANotice) <> S_OK)
  83. // or (Connection = nil) then
  84. // Exit;
  85. end;
  86. procedure TAppNoticeProvider.Update(AValue: IInterface);
  87. var
  88. ANotice: IAppNotice;
  89. begin
  90. // if (AValue = nil)
  91. // or (AValue.QueryInterface(IAppNotice, ANotice) <> S_OK)
  92. // or (Connection = nil) then
  93. // Exit;
  94. end;
  95. { TAppNotice }
  96. function TAppNotice.GetContent: AnsiString;
  97. begin
  98. Result := FContent;
  99. end;
  100. function TAppNotice.GetID: AnsiString;
  101. begin
  102. Result := FID;
  103. end;
  104. function TAppNotice.GetLoginName: AnsiString;
  105. begin
  106. end;
  107. function TAppNotice.GetTitle: AnsiString;
  108. begin
  109. Result := FTitle;
  110. end;
  111. function TAppNotice.GetURL: AnsiString;
  112. begin
  113. Result := FURL;
  114. end;
  115. procedure TAppNotice.SetContent(const Value: AnsiString);
  116. begin
  117. FContent := Value;
  118. end;
  119. procedure TAppNotice.SetID(const Value: AnsiString);
  120. begin
  121. FID := Value;
  122. end;
  123. procedure TAppNotice.SetLoginName(const Value: AnsiString);
  124. begin
  125. end;
  126. procedure TAppNotice.SetTitle(const Value: AnsiString);
  127. begin
  128. FTitle := Value;
  129. end;
  130. procedure TAppNotice.SetURL(const Value: AnsiString);
  131. begin
  132. FURL := Value;
  133. end;
  134. end.