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

📄 servercontroller.pas

📁 人力资源的信息。其他人不需帐号就可自由下载此源码
💻 PAS
字号:
unit ServerController;
{PUBDIST}

interface

uses
  Classes,
  DatamoduleUnit,
  IWServerControllerBase, IWAppForm, IWApplication,
  SysUtils;

type
  TIWServerController = class(TIWServerControllerBase)
    procedure IWServerControllerBaseNewSession(ASession: TIWApplication;
      var VMainForm: TIWAppForm);
  private
  public
  end;

  // This is a class which you can add variables to that are specific to the user. Add variables
  // to this class instead of creating global variables. This object can references by using:
  //   UserSession
  // So if a variable named UserName of type string is added, it can be referenced by using:
  //   UserSession.UserName
  // Such variables are similar to globals in a normal application, however these variables are
  // specific to each user.
  //
  // See the IntraWeb Manual for more details.
  TUserSession = class(TComponent)
  private
    FCanEdit: Boolean;
    FUserName: string;
    FUserPass: string;
    procedure SetCanEdit(const Value: Boolean);
    procedure SetUserName(const Value: string);
    procedure SetUserPass(const Value: string);
  public
    DataModule1: TdmHR;
    //
    constructor Create(AOwner: TComponent); override;
  published
    property UserName:string read FUserName write SetUserName;
    property UserPass:string read FUserPass write SetUserPass;
    property CanEdit:Boolean read FCanEdit write SetCanEdit;
  end;

// Procs
  function UserSession: TUserSession;

implementation
{$R *.DFM}

uses
  IWInit;

function UserSession: TUserSession;
begin
  Result := TUserSession(RWebApplication.Data);
end;

{ TUserSession }

constructor TUserSession.Create(AOwner: TComponent);
begin
  inherited;
  Datamodule1 := TdmHR.Create(AOwner);
end;

procedure TIWServerController.IWServerControllerBaseNewSession(
  ASession: TIWApplication; var VMainForm: TIWAppForm);
begin
  ASession.Data := TUserSession.Create(ASession);
end;

procedure TUserSession.SetCanEdit(const Value: Boolean);
begin
  FCanEdit := Value;
end;

procedure TUserSession.SetUserName(const Value: string);
begin
  FUserName := Value;
end;

procedure TUserSession.SetUserPass(const Value: string);
begin
  FUserPass := Value;
end;

end.

⌨️ 快捷键说明

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