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.