Files
lazarus-ccr/wst/trunk/samples/user_client/user_edit_imp.pas
inoussa 74d5466765 client : new TCP transport implementation ( using synapse library ) in synapse_tcp_protocol.pas
server : TCP server implementatiion ( using synapse library ) in synapse_tcp_server.pas
Delphi : first binary format support
bugs fix in the WSDL generation for the server side

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@158 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2007-05-02 22:55:35 +00:00

74 lines
1.4 KiB
ObjectPascal

unit user_edit_imp;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Buttons, StdCtrls, RTTICtrls, user_service_intf;
type
{ TfUserEdit }
TfUserEdit = class(TForm)
btnOk: TButton;
Button2: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Panel1: TPanel;
Panel2: TPanel;
edtCategory: TTIComboBox;
edtName: TTIEdit;
edteMail: TTIEdit;
edtPreferences: TTIEdit;
private
FInfos: TUser;
public
constructor Create(AOwner : TComponent);override;
destructor Destroy();override;
property Infos : TUser read FInfos;
function UpdateObject( AUser : TUser ) : Boolean;
end;
var
fUserEdit: TfUserEdit;
implementation
{ TfUserEdit }
constructor TfUserEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FInfos := TUser.Create();
edtName.Link.TIObject := FInfos;
edteMail.Link.TIObject := FInfos;
edtPreferences.Link.TIObject := FInfos;
edtCategory.Link.TIObject := FInfos;
end;
destructor TfUserEdit.Destroy();
begin
FreeAndNil(FInfos);
inherited Destroy();
end;
function TfUserEdit.UpdateObject(AUser: TUser): Boolean;
begin
Infos.Assign(AUser);
Result := ( ShowModal() = mrOK );
if Result then begin
AUser.Assign(Infos);
end;
end;
initialization
{$I user_edit_imp.lrs}
end.