📄 uvadirservice.pas
字号:
unit UVADIRservice;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, UAdapterDataItemView, dxPSGlbl, dxPSUtl, dxPSEngn, dxPrnPg,
dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns,
dxPSEdgePatterns, DB, dxPSCore, RzCommon, RzButton, jpeg, RzBckgnd,
ExtCtrls, RzPanel, StdCtrls, Mask, RzEdit, RzDBEdit, RzLabel, DBCtrls,
RzDBCmbo, UMADRservice, UCloneDataModel, UDialogDataItemsView, UDataItemsView,
MyTools;
type
TVADIRservice = class(TAdapterDataItemView)
Reckoning: TDataSource;
Units: TDataSource;
Service: TDataSource;
RzDBEdit2: TRzDBEdit;
RzLabel2: TRzLabel;
RzDBEdit3: TRzDBEdit;
RzLabel3: TRzLabel;
RzLabel5: TRzLabel;
RzLabel4: TRzLabel;
RzDBLookupComboBox1: TRzDBLookupComboBox;
RzBitBtn1: TRzBitBtn;
RzLabel8: TRzLabel;
RzDBLookupComboBox5: TRzDBLookupComboBox;
RzLabel9: TRzLabel;
RzDBLookupComboBox6: TRzDBLookupComboBox;
RzLabel10: TRzLabel;
ServiceCatalog: TDataSource;
RzDBLookupComboBox4: TRzDBLookupComboBox;
RzDBNumericEdit1: TRzDBNumericEdit;
procedure RzBitBtn1Click(Sender: TObject);
private
ServiceCatalogModel: TCloneDataModel;
UnitsModel: TCloneDataModel;
ServiceModel: TCloneDataModel;
protected
procedure InitModel; override;
public
function GetCaption: string; override;
end;
implementation
uses
Factory, UPrimaryDataModel, UMADReckoning, UMADUnits, UMADService,
UMADServiceCatalog, UVADGService, UDataView;
{$R *.dfm}
{ TVADIRservice }
function TVADIRservice.GetCaption: string;
begin
Result := '服务账单';
end;
procedure TVADIRservice.InitModel;
begin
inherited;
ServiceCatalogModel := GetCloneDataModel(TPrimaryDataModel(ServiceCatalogFactory.GetModel));
ServiceCatalog.DataSet := ServiceCatalogModel.GetDataSet;
UnitsModel := GetCloneDataModel(TPrimaryDataModel(UnitsFactory.GetModel));
Units.DataSet := UnitsModel.GetDataSet;
ServiceModel := GetCloneDataModel(TPrimaryDataModel(ServiceFactory.GetModel));
Service.DataSet := ServiceModel.GetDataSet;
end;
procedure TVADIRservice.RzBitBtn1Click(Sender: TObject);
var
Dialog : TDialogDataItemsView;
View: TVADGService;
begin
GetDataModel.GetDataSet.Edit;
View := TVADGService.Create(Self,ServiceFactory);
Dialog := TDialogDataItemsView.Create(Self, TDataItemsView(View));
if Dialog.ShowModal = mrOk then
begin
GetDataModel.GetDataSet.FieldByName('ServiceID').AsInteger := IIntegerKey(Dialog.GetKey).GetKey;
end;
View.Free;
Dialog.Free;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -