CdsDeltaDm.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:2k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit CdsDeltaDm;
- interface
- uses
- SysUtils, Classes, FMTBcd, DBXpress, DB, SqlExpr, DBClient, Provider;
- type
- TDmCds = class(TDataModule)
- cdsEmployee: TClientDataSet;
- cdsDelta: TClientDataSet;
- SQLConnection: TSQLConnection;
- EmplData: TSQLDataSet;
- EmplProvider: TDataSetProvider;
- cdsDeltaStatus: TStringField;
- cdsEmployeeStatus: TStringField;
- cdsEmployeeDEPT_NO: TStringField;
- cdsEmployeeEMP_NO: TSmallintField;
- cdsEmployeeFIRST_NAME: TStringField;
- cdsEmployeeLAST_NAME: TStringField;
- cdsEmployeePHONE_EXT: TStringField;
- cdsDeltaDEPT_NO: TStringField;
- cdsDeltaEMP_NO: TSmallintField;
- cdsDeltaFIRST_NAME: TStringField;
- cdsDeltaLAST_NAME: TStringField;
- cdsDeltaSALARY: TBCDField;
- cdsDeltaPHONE_EXT: TStringField;
- cdsEmployeeSALARY: TFMTBCDField;
- procedure CalcStatusField(DataSet: TDataSet);
- procedure cdsEmployeeReconcileError(DataSet: TCustomClientDataSet;
- E: EReconcileError; UpdateKind: TUpdateKind;
- var Action: TReconcileAction);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- DmCds: TDmCds;
- implementation
- {$R *.dfm}
- uses
- TypInfo, Reconc;
- procedure TDmCds.CalcStatusField(DataSet: TDataSet);
- begin
- DataSet.FieldByName('Status').AsString :=
- GetEnumName (TypeInfo(TUpdateStatus),
- Integer ((DataSet as TClientDataSet).UpdateStatus));
- end;
- procedure TDmCds.cdsEmployeeReconcileError(
- DataSet: TCustomClientDataSet; E: EReconcileError;
- UpdateKind: TUpdateKind; var Action: TReconcileAction);
- begin
- Action := HandleReconcileError(DataSet, UpdateKind, E);
- end;
- end.