wsnapdata.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit wsnapdata;
- interface
- uses
- Windows, Messages, SysUtils, Classes, HTTPApp, WebModu, DBXpress, FMTBcd,
- Provider, SqlExpr, DB, DBClient;
- type
- TWebDataModule1 = class(TWebDataModule)
- ClientDataSet1: TClientDataSet;
- SQLConnection1: TSQLConnection;
- SQLDataSet1: TSQLDataSet;
- DataSetProvider1: TDataSetProvider;
- procedure ClientDataSet1AfterPost(DataSet: TDataSet);
- procedure ClientDataSet1AfterDelete(DataSet: TDataSet);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- function WebDataModule1: TWebDataModule1;
- implementation
- {$R *.dfm}
- uses WebReq, WebCntxt, WebFact, Variants;
- function WebDataModule1: TWebDataModule1;
- begin
- Result := TWebDataModule1(WebContext.FindModuleClass(TWebDataModule1));
- end;
- procedure TWebDataModule1.ClientDataSet1AfterPost(DataSet: TDataSet);
- begin
- ClientDataSet1.ApplyUpdates(-1);
- end;
- procedure TWebDataModule1.ClientDataSet1AfterDelete(DataSet: TDataSet);
- begin
- ClientDataSet1.ApplyUpdates(-1);
- end;
- initialization
- if WebRequestHandler <> nil then
- WebRequestHandler.AddWebModuleFactory(TWebDataModuleFactory.Create(TWebDataModule1, crAlways, caCache));
- end.