uvadirecipe.pas

来自「一整套的源代码」· PAS 代码 · 共 80 行

PAS
80
字号
unit UVADIRecipe;

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, RzRadChk, RzDBChk, UCloneDataModel, UPrimaryDataModel, Factory;

type
  TVADIRecipe = class(TAdapterDataItemView)
    RzDBEdit1: TRzDBEdit;
    RzLabel1: TRzLabel;
    RzLabel5: TRzLabel;
    RzLabel8: TRzLabel;
    RzLabel9: TRzLabel;
    RzDBLookupComboBox2: TRzDBLookupComboBox;
    RzDBLookupComboBox3: TRzDBLookupComboBox;
    Sick: TDataSource;
    Doctor: TDataSource;
    Reckoning: TDataSource;
    RzDBLookupComboBox4: TRzDBLookupComboBox;
    RzBitBtn1: TRzBitBtn;
    procedure RzBitBtn1Click(Sender: TObject);
  private
    ReckoningModel: TCloneDataModel;
    DoctorModel: TCloneDataModel;
    SickModel: TCloneDataModel;
  protected
    procedure InitModel; override;
  public
    function GetCaption: string; override;
  end;

implementation

uses
  UMADRecipe, UMADEmployee, UMADDoctor, UMADReckoning ,
  UMADSick, UDialogDataItemsView, UVMADGSick, UDataItemsView, MyTools;

{$R *.dfm}

{ TVADIRecipe }

function TVADIRecipe.GetCaption: string;
begin
  Result := '处方';
end;

procedure TVADIRecipe.InitModel;
begin
  inherited;
  SickModel := GetCloneDataModel(TPrimaryDataModel(SickFactory.GetModel));
  Sick.DataSet := SickModel.GetDataSet;

  ReckoningModel := GetCloneDataModel(TPrimaryDataModel(ReckoningFactory.GetModel));
  Reckoning.DataSet := ReckoningModel.GetDataSet;

  DoctorModel := GetCloneDataModel(TPrimaryDataModel(DoctorFactory.GetModel));
  Doctor.DataSet := DoctorModel.GetDataSet;
end;

procedure TVADIRecipe.RzBitBtn1Click(Sender: TObject);
var
  Dialog: TDialogDataItemsView;
begin
  inherited;
  Dialog := TDialogDataItemsView.Create(Self, TDataItemsView(TVMADGSick.Create(Self, SickTodayFactory)));
  if Dialog.ShowModal = mrOk then
  begin
    GetDataModel.GetDataSet.FieldByName('SickID').AsInteger := IIntegerKey(Dialog.GetKey).GetKey;
  end;
  Dialog.Free;
end;

end.

⌨️ 快捷键说明

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