home *** CD-ROM | disk | FTP | other *** search
- unit cliente;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls;
-
- type
- TForm1 = class(TForm)
- Label1: TLabel;
- Edit1: TEdit;
- Label2: TLabel;
- ComboBox1: TComboBox;
- DBGrid1: TDBGrid;
- DBGrid2: TDBGrid;
- DBNavigator1: TDBNavigator;
- DBNavigator2: TDBNavigator;
- procedure FormCreate(Sender: TObject);
- procedure ComboBox1Change(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses client2;
-
- {$R *.DFM}
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- DataModule2.clientdataset3.Open;
- while not Datamodule2.Clientdataset3.EOF do
- begin
- Combobox1.Items.Add(Datamodule2.ClientDataset3.FieldByName('Job_Code').AsString);
- Datamodule2.Clientdataset3.Next;
- end;
- Datamodule2.Clientdataset3.Close;
- end;
-
- procedure TForm1.ComboBox1Change(Sender: TObject);
- begin
- with Datamodule2.Clientdataset1 do
- begin
- {fetchparams lo utilizamos para que nuestro
- programa internamenete sepa los parametros que hay en el servidor
- ya que si no llamamos a FetchParams no encontrara
- los parßmetros}
- if Params.Count = 0 then FetchParams;
- {establecemos los parßmetros.}
- Params.ParamByName('Job_Code').AsString :=
- combobox1.Text;
- Params.ParamByName('Job_Grade').AsInteger :=
- StrToInt(Edit1.Text);
- {Si el clientdataset de employee no esta activo lo
- abrimos. Al abrir el dataset envia los parßmetros
- al servidor. Si este continua abierto llama a
- SendParams para enviar un nuevo valor para el parßmetro
- al servidor y refresca el dataset}
- if not Active then
- Open
- else begin
- SendParams;
- Refresh;
- end;
- end;
- if not Datamodule2.clientdataset2.Active then
- datamodule2.clientdataset2.Open;
-
- end;
-
- end.
-
-
-
-