⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ffdata.pas

📁 Delphi 控件源码
💻 PAS
字号:
unit FFData;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, ADODB;

type
  TFFDatamodule = class(TDataModule)
    Session1: TSession;
    dsrcMain: TDataSource;
    ADOConnection1: TADOConnection;
    xueliQuery: TADOQuery;
    xueliSource: TDataSource;
    patientDataSource: TDataSource;
    medicaQuery: TADOQuery;
    medicaSource: TDataSource;
    laboratorySource: TDataSource;
    laboratoryQuery: TADOQuery;
    updateMain: TADOQuery;
    updatePatient: TADOQuery;
    updateMedica: TADOQuery;
    updateLaboratory: TADOQuery;
    qeryMain: TADOQuery;
    patientQuery: TADOQuery;
    procedure DataModuleCreate(Sender: TObject);
  private
  public
    procedure GoFish(const ASpeciesNo: integer);
    procedure MovePage(const APageSize: integer);
    procedure SortBy(const AFieldname: string);
  end;

// Procs
  function FFDatamodule: TFFDatamodule;

implementation
{$R *.DFM}

uses
  IWServer, IWInit,
  ServerController;

// Since we are threaded we cannot use global variables to store form / datamodule references
// so we store them in WebApplication.Data and we could reference that each time, but by creating
// a function like this our other code looks "normal" almost as if its referencing a global.
// This function is not necessary but it makes the code in the main form which references this
// datamodule a lot neater.
// Without this function ever time we would reference this datamodule we would use:
//   TFFSession(WebApplication.Data).FFDatamodule.<method / component>
// By creating this procedure it becomes:
//   FFDatamodule.<method / component>
// Which is just like normal Delphi code.
function FFDatamodule: TFFDatamodule;
begin
  Result := TFFSession(RWebApplication.Data).FFDatamodule;
end;

procedure TFFDatamodule.DataModuleCreate(Sender: TObject);
begin
  qeryMain.Open;
end;

procedure TFFDatamodule.GoFish(const ASpeciesNo: integer);
begin
  //qeryMain.Locate('Species No', ASpeciesNo, []);
end;

procedure TFFDatamodule.MovePage(const APageSize: integer);
begin
  qeryMain.MoveBy(APageSize);
end;

procedure TFFDatamodule.SortBy(const AFieldname: string);
//var
  //LSpeciesNo: integer;
begin
  //LSpeciesNo := Trunc(qeryMainSpeciesNo.Value);
  //qeryMain.Close; try
    //qeryMain.SQL.Text := 'select * from biolife order by biolife."' + AFieldName + '"';
    //qeryMain.SQL.Text := 'select * from bingli ';
    //qeryMain.Open;  
  //finally qeryMain.Open; end;
  //GoFish(LSpeciesNo);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -