uvadirmedicine.pas

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

PAS
76
字号
unit UVADIRmedicine;

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, DBCtrls, RzDBCmbo, StdCtrls, Mask, RzEdit, RzDBEdit,
  RzLabel, UMADRmedicine, UCloneDataModel, UDialogDataItemsView, UDataItemsView,
  MyTools;

type
  TVADIRmedicine = class(TAdapterDataItemView)
    PStockMedicine: TDataSource;
    RzLabel2: TRzLabel;
    RzLabel3: TRzLabel;
    RzDBEdit3: TRzDBEdit;
    RzDBEdit4: TRzDBEdit;
    RzLabel4: TRzLabel;
    RzDBLookupComboBox2: TRzDBLookupComboBox;
    RzLabel7: TRzLabel;
    RzLabel11: TRzLabel;
    RzDBLookupComboBox6: TRzDBLookupComboBox;
    RzBitBtn1: TRzBitBtn;
    Medicine: TDataSource;
    RzDBLookupComboBox1: TRzDBLookupComboBox;
    procedure RzBitBtn1Click(Sender: TObject);
  private
    PStockMedicineModel: TCloneDataModel;
    MedicineModel: TCloneDataModel;
  protected
    procedure InitModel; override;
  public
    function GetCaption: string; override;
  end;

implementation

uses UMADVPStockMedicine, Factory, UPrimaryDataModel, UMADMedicine,
  UVADGVPStockMedicine;

{$R *.dfm}

{ TVADIRmedicine }

function TVADIRmedicine.GetCaption: string;
begin
  Result := '物资账单';
end;

procedure TVADIRmedicine.InitModel;
begin
  inherited;
  PStockMedicineModel := GetCloneDataModel(TPrimaryDataModel(VPStockmedicineFactory.GetModel));
  PStockMedicine.DataSet := PStockMedicineModel.GetDataSet;

  MedicineModel := GetCloneDataModel(TPrimaryDataModel(MedicineFactory.GetModel));
  Medicine.DataSet := MedicineModel.GetDataSet;

end;

procedure TVADIRmedicine.RzBitBtn1Click(Sender: TObject);
var
  Dialog : TDialogDataItemsView;
begin
  GetDataModel.GetDataSet.Edit;
  Dialog := TDialogDataItemsView.Create(Self,TDataItemsView(TVADGVPStockMedicine.Create(Self, VPStockmedicineFactory)));
  if Dialog.ShowModal = mrOk then
    GetDataModel.GetDataSet.FieldByName('PStockmedicineID').AsInteger := IIntegerKey(Dialog.GetKey).GetKey;
  Dialog.Free;
end;

end.

⌨️ 快捷键说明

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