unit stscl1;
//Client of Simple MTS server
//By N.Elmanova
//01.12.1998
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBClient, MConnect, Grids, DBGrids, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
DBGrid1: TDBGrid;
DCOMConnection1: TDCOMConnection;
ClientDataSet1: TClientDataSet;
DataSource1: TDataSource;
Button2: TButton;
Button3: TButton;
Label2: TLabel;
Label1: TLabel;
Edit1: TEdit;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
DCOMConnection1.Connected:=True;
ClientDataSet1.Data:=DCOMConnection1.AppServer.GetGoods;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
try
DCOMConnection1.AppServer.AddGoods(Edit1.Text,
StrToInt(Edit2.Text));
Except
ShowMessage('Не могу добавить запись');
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var recnum:integer;
begin
recnum:=ClientDataSet1.FieldByName('GOODSNUMBER').Value;
try
DCOMConnection1.AppServer.DeleteGoods(recnum);
except
ShowMessage('Не могу удалить запись');
end;
end;
end.