| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- unit AppNoticeProvicer;
- interface
- uses
- System.Classes, InterfaceDataProvider, mybean.core.objects, BaseDataProvider;
- type
- TAppNoticeProvider = class(TBaseDataProvider, IAppNoticeDateProvider)
- public
- function FindOne (ID: Integer): IInterface; stdcall;
- function FindAll(): IInterfaceList; stdcall;
- procedure Delete(AValue: IInterface); stdcall;
- procedure Update(AValue: IInterface); stdcall;
- procedure Insert(AValue: IInterface); overload; stdcall;
- procedure Insert(AValues: IInterfaceList); overload; stdcall;
- end;
- TAppNotice = class(TInterfacedObject, IAppNotice)
- private
- FID,
- FContent,
- FTitle,
- FURL: AnsiString;
- public
- function GetContent: AnsiString; stdcall;
- function GetID: AnsiString; stdcall;
- function GetTitle: AnsiString; stdcall;
- function GetURL: AnsiString; stdcall;
- function GetLoginName: AnsiString; stdcall;
- procedure SetLoginName(const Value: AnsiString); stdcall;
- procedure SetContent(const Value: AnsiString); stdcall;
- procedure SetID(const Value: AnsiString); stdcall;
- procedure SetTitle(const Value: AnsiString); stdcall;
- procedure SetURL(const Value: AnsiString); stdcall;
- property ID: AnsiString read GetID write SetID;
- property Content: AnsiString read GetContent write SetContent;
- property Title: AnsiString read GetTitle write SetTitle;
- property URL: AnsiString read GetURL write SetURL;
- end;
- implementation
- const
- APP_NOTICES_TABLE_NAME: string = 'AppNotices';
- APP_NOTICES_CREATE_TABLE: string = 'CREATE TABLE AppNotices('+
- 'LoginName string(50), ' +
- 'DisplayName string(50), ' +
- 'ServerID string(50), ' +
- 'Version Integer, ' +
- 'Sex byte)';
- APP_NOTICE_INSERT: string =
- 'Insert into AppNotices(LoginName, DisplayName, ServerID, Version, Sex) ' +
- 'Values(:LoginName, :DisplayName, :ServerID, :Version, :Sex)';
- APP_NOTICE_UPDATE: string = 'Update AppNotices Set DisplayName = :DisplayName, ' +
- 'Version = :Version, ' +
- 'Sex = :Sex, ' +
- 'Where LoginName = :LoginName and ServerID = :ServerID';
- APP_NOTICE_DELETE: string = 'Delete from AppNotices where LoginName = :LoginName and ServerID = :ServerID';
- APP_NOTICE_SELETE_ONE: string = 'Selete LoginName, DisplayName, ServerID, Version, Sex From AppNotices ' +
- 'Where LoginName = :LoginName and ServerID = :ServerID';
- APP_NOTICE_SELETE_ALL: string = 'Selete LoginName, DisplayName, ServerID, Version, Sex From AppNotices ' +
- 'Where ServerID = :ServerID';
- { TAppNoticeProvider }
- procedure TAppNoticeProvider.Delete(AValue: IInterface);
- var
- ANotice: IAppNotice;
- begin
- // if (AValue = nil)
- // or (AValue.QueryInterface(IAppNotice, ANotice) <> S_OK)
- // or (Connection = nil) then
- // Exit;
- end;
- function TAppNoticeProvider.FindAll: IInterfaceList;
- begin
- end;
- function TAppNoticeProvider.FindOne(ID: Integer): IInterface;
- begin
- end;
- procedure TAppNoticeProvider.Insert(AValues: IInterfaceList);
- begin
- end;
- procedure TAppNoticeProvider.Insert(AValue: IInterface);
- var
- ANotice: IAppNotice;
- begin
- // if (AValue = nil)
- // or (AValue.QueryInterface(IAppNotice, ANotice) <> S_OK)
- // or (Connection = nil) then
- // Exit;
- end;
- procedure TAppNoticeProvider.Update(AValue: IInterface);
- var
- ANotice: IAppNotice;
- begin
- // if (AValue = nil)
- // or (AValue.QueryInterface(IAppNotice, ANotice) <> S_OK)
- // or (Connection = nil) then
- // Exit;
- end;
- { TAppNotice }
- function TAppNotice.GetContent: AnsiString;
- begin
- Result := FContent;
- end;
- function TAppNotice.GetID: AnsiString;
- begin
- Result := FID;
- end;
- function TAppNotice.GetLoginName: AnsiString;
- begin
- end;
- function TAppNotice.GetTitle: AnsiString;
- begin
- Result := FTitle;
- end;
- function TAppNotice.GetURL: AnsiString;
- begin
- Result := FURL;
- end;
- procedure TAppNotice.SetContent(const Value: AnsiString);
- begin
- FContent := Value;
- end;
- procedure TAppNotice.SetID(const Value: AnsiString);
- begin
- FID := Value;
- end;
- procedure TAppNotice.SetLoginName(const Value: AnsiString);
- begin
- end;
- procedure TAppNotice.SetTitle(const Value: AnsiString);
- begin
- FTitle := Value;
- end;
- procedure TAppNotice.SetURL(const Value: AnsiString);
- begin
- FURL := Value;
- end;
- end.
|