Browse Subversion Repository
Contents of /UserSessionUnit.pas
Parent Directory
| Revision Log
Revision 1 -
( show annotations)
( download)
( as text)
Sun Nov 22 11:18:44 2015 UTC
(8 years, 4 months ago)
by yamat0jp
File MIME type: text/x-pascal
File size: 1350 byte(s)
方向性はあってますが技術的に行き詰っています.IntraWebの情報・経験が不足しています.
ボタンでフォームを切り替えることさえうまくいきませんがセッションの問題でしょうか?
| 1 |
unit UserSessionUnit; |
| 2 |
|
| 3 |
{ |
| 4 |
This is a DataModule where you can add components or declare fields that are specific to |
| 5 |
ONE user. Instead of creating global variables, it is better to use this datamodule. You can then |
| 6 |
access the it using UserSession. |
| 7 |
} |
| 8 |
interface |
| 9 |
|
| 10 |
uses |
| 11 |
IWUserSessionBase, SysUtils, Classes, FireDAC.Stan.Intf, FireDAC.Stan.Option, |
| 12 |
FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, |
| 13 |
FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt, FireDAC.UI.Intf, |
| 14 |
FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Phys, FireDAC.Phys.IB, |
| 15 |
FireDAC.Phys.IBDef, Data.DB, FireDAC.Comp.Client, FireDAC.Comp.DataSet, Unit4; |
| 16 |
|
| 17 |
type |
| 18 |
TPage = (Main,Info); |
| 19 |
|
| 20 |
TIWUserSession = class(TIWUserSessionBase) |
| 21 |
procedure IWUserSessionBaseDestroy(Sender: TObject); |
| 22 |
private |
| 23 |
FDM: TDataModule1; |
| 24 |
function GetDM: TDataModule1; |
| 25 |
{ Private declarations } |
| 26 |
public |
| 27 |
{ Public declarations } |
| 28 |
user_number: integer; |
| 29 |
FPage: TPage; |
| 30 |
property DM: TDataModule1 read GetDM; |
| 31 |
end; |
| 32 |
|
| 33 |
implementation |
| 34 |
|
| 35 |
{$R *.dfm} |
| 36 |
|
| 37 |
{ TIWUserSession } |
| 38 |
|
| 39 |
function TIWUserSession.GetDM: TDataModule1; |
| 40 |
begin |
| 41 |
if Assigned(FDM) = false then |
| 42 |
FDM:=TDataModule1.Create(nil); |
| 43 |
result:=FDM; |
| 44 |
end; |
| 45 |
|
| 46 |
procedure TIWUserSession.IWUserSessionBaseDestroy(Sender: TObject); |
| 47 |
begin |
| 48 |
FreeAndNil(FDM); |
| 49 |
end; |
| 50 |
|
| 51 |
end. |
| 52 |
|
| |