Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit LeopardGerenciador.Core.HorseApi.HorseServices.HorseServicesIInterfaces.HorseSrvIInterfaces;
- interface
- uses
- system.Classes,System.SysUtils,Vcl.Forms,Horse,Horse.Jhonson,System.JSON,System.Threading;
- Type TOnEventsHorse = procedure(const Arg: String) of object;
- Type
- THorseLogEvent = class
- private
- FOnEventsHorse: TOnEventsHorse;
- FTempoConectado: double;
- FMensagem: string;
- FHeader: string;
- FTipo: string;
- FStringBuilder: TStringBuilder;
- procedure SetOnEventsHorse(const Value: TOnEventsHorse);
- procedure SetMensagem(const Value: string);
- procedure SetTempoConectado(const Value: double);
- procedure SetHeader(const Value: string);
- procedure SetTipo(const Value: string);
- public
- procedure AfterConstruction; override;
- procedure BeforeDestruction; override;
- published
- property Tipo: string read FTipo write SetTipo;
- property Header: string read FHeader write SetHeader;
- property Mensagem: string read FMensagem write SetMensagem;
- property TempoConectado: double read FTempoConectado write SetTempoConectado;
- property OnEventsHorse: TOnEventsHorse read FOnEventsHorse write SetOnEventsHorse;
- function Notificar:THorseLogEvent;
- end;
- type
- IhorseSrvControlelotes = Interface
- ['{02E5BC80-6D1F-4015-94A6-D3F43ADC14B0}']
- function InjectHorseHttp(var Horse:THorse ):IhorseSrvControlelotes;
- function GetLotesMovimentados:IhorseSrvControlelotes;
- function GetLotesMonth:IhorseSrvControlelotes;
- End;
- Type IHorseSrvNfe = Interface
- ['{475AAB43-789A-474E-9285-6E0E9A23C4D5}']
- function ConsultarServicoSefaz:IHorseSrvNfe;
- function PostDadosEmitente(Arg: TJSONObject = nil):IHorseSrvNfe;
- function InjectHorseHttp(var Horse:THorse ):IHorseSrvNfe;
- function IniciarNota:IHorseSrvNFe;
- function HelperDocument:IHorseSrvNFe;
- End;
- var _EVentos:THorseLogEvent;
- implementation
- uses
- Lib.System.Classes.Helpers.ClassesAppAndObjetcs.Controller, Lib.System.PrimitiveTypes.Helpers.Controller,
- Lib.System.RTTI.Helper.Controller;
- { THorseLogEvent }
- procedure THorseLogEvent.AfterConstruction;
- begin
- inherited;
- FStringBuilder := TStringBuilder.Create;
- end;
- procedure THorseLogEvent.BeforeDestruction;
- begin
- inherited;
- FreeAndNil( FStringBuilder );
- end;
- function THorseLogEvent.Notificar: THorseLogEvent;
- begin
- TTask.Run(
- procedure
- begin
- TThread.Queue(TThread.CurrentThread,
- procedure
- begin
- if Assigned(FOnEventsHorse) then
- FOnEventsHorse(FStringBuilder.ToString);
- FStringBuilder.Clear;
- end);
- end);
- end;
- procedure THorseLogEvent.SetHeader(const Value: string);
- begin
- FHeader := Value;
- FStringBuilder.Append(Value).AppendLine;
- end;
- procedure THorseLogEvent.SetMensagem(const Value: string);
- begin
- FMensagem := Value;
- FStringBuilder.Append(Value).AppendLine;
- Notificar;
- end;
- procedure THorseLogEvent.SetOnEventsHorse(const Value: TOnEventsHorse);
- begin
- FOnEventsHorse := Value;
- end;
- procedure THorseLogEvent.SetTempoConectado(const Value: double);
- begin
- FTempoConectado := Value;
- end;
- procedure THorseLogEvent.SetTipo(const Value: string);
- begin
- FTipo := Value;
- FStringBuilder.Append(Value).AppendLine;
- end;
- initialization
- _EVentos := THorseLogEvent.Create;
- finalization
- FreeAndNil( _EVentos );
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement