ThinForm.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:2k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit ThinForm;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   DBClient, MConnect, SConnect, Db, Grids, DBGrids, StdCtrls, ObjBrkr;
  6. type
  7.   TClientForm = class(TForm)
  8.     Connection: TSocketConnection;
  9.     cds: TClientDataSet;
  10.     DBGrid1: TDBGrid;
  11.     DataSource1: TDataSource;
  12.     ButtonFetch: TButton;
  13.     Button1: TButton;
  14.     CheckBox1: TCheckBox;
  15.     Edit2: TEdit;
  16.     Edit3: TEdit;
  17.     cdsDet: TClientDataSet;
  18.     DataSource2: TDataSource;
  19.     DBGrid2: TDBGrid;
  20.     cdsCustNo: TFloatField;
  21.     cdsCompany: TStringField;
  22.     cdsAddr1: TStringField;
  23.     cdsAddr2: TStringField;
  24.     cdsCity: TStringField;
  25.     cdsState: TStringField;
  26.     cdsZip: TStringField;
  27.     cdsCountry: TStringField;
  28.     cdsPhone: TStringField;
  29.     cdsFAX: TStringField;
  30.     cdsTaxRate: TFloatField;
  31.     cdsContact: TStringField;
  32.     cdsLastInvoiceDate: TDateTimeField;
  33.     cdsTableOrders: TDataSetField;
  34.     Button2: TButton;
  35.     ConnectionBroker1: TConnectionBroker;
  36.     procedure ButtonFetchClick(Sender: TObject);
  37.     procedure Button1Click(Sender: TObject);
  38.     procedure CheckBox1Click(Sender: TObject);
  39.     procedure ConnectionAfterConnect(Sender: TObject);
  40.     procedure Button2Click(Sender: TObject);
  41.   private
  42.     { Private declarations }
  43.   public
  44.     { Public declarations }
  45.   end;
  46. var
  47.   ClientForm: TClientForm;
  48. implementation
  49. uses QueForm;
  50. {$R *.DFM}
  51. procedure TClientForm.ButtonFetchClick(Sender: TObject);
  52. begin
  53.   ButtonFetch.Caption := IntToStr (cds.GetNextPacket);
  54. end;
  55. procedure TClientForm.Button1Click(Sender: TObject);
  56. begin
  57.   cds.ApplyUpdates (-1);
  58. end;
  59. procedure TClientForm.CheckBox1Click(Sender: TObject);
  60. begin
  61.   cds.Active := Checkbox1.Checked;
  62.   cdsDet.Active := Checkbox1.Checked;
  63.   Connection.Connected := Checkbox1.Checked;
  64. end;
  65. procedure TClientForm.ConnectionAfterConnect(Sender: TObject);
  66. begin
  67.   Connection.AppServer.Login (Edit2.Text, Edit3.Text);
  68. end;
  69. procedure TClientForm.Button2Click(Sender: TObject);
  70. begin
  71.   FormQuery.Show;
  72. end;
  73. end.