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

📄 datamoduleunit.pas

📁 HR人力资源 (修改版) 含开发手记
💻 PAS
字号:
unit DatamoduleUnit;

interface

uses
  {$IFDEF Linux}QForms, {$ELSE}Forms, {$ENDIF}
  SysUtils, Classes, DB, ADODB;

type
  TdmHR = class(TDataModule)
    adocHR: TADOConnection;
    dsCorp: TDataSource;
    adocEdit: TADOCommand;
    dsHuman: TDataSource;
    BADOCorp: TADODataSet;
    BADOCorpCorpID: TAutoIncField;
    BADOCorpChnName: TWideStringField;
    BADOCorpEngName: TWideStringField;
    BADOCorpPhone: TWideStringField;
    BADOCorpFax: TWideStringField;
    BADOCorpChnInfo: TMemoField;
    BADOCorpEngInfo: TMemoField;
    BADOCorpComments: TMemoField;
    BADOHuman: TADODataSet;
    BADOSex: TADODataSet;
    BADOCountry: TADODataSet;
    BADOEduLevel: TADODataSet;
    BADOEngLevel: TADODataSet;
    BADOTech: TADODataSet;
    BADOTechLevel: TADODataSet;
    BADOHumanTech: TADODataSet;
    BADOOperator: TADODataSet;
    BADOQuery: TADODataSet;
  private
  public
  end;

// Procs
  function dmHR: TdmHR;

implementation
{$R *.dfm}

uses
  IWInit,
  ServerController{, DatamoduleUnit};

// 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:
//   TDataModule1(WebApplication.Data).Datamodule.<method / component>
// By creating this procedure it becomes:
//   TDataModule1.<method / component>
// Which is just like normal Delphi code.
function dmHR: TdmHR;
begin
  Result := TUserSession(RWebApplication.Data).DataModule1;
end;

end.
 

⌨️ 快捷键说明

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