unit rmGridHeaderDm;

interface

uses
  SysUtils, Classes, ProjectData, DB, DBClient;

type
  TrmGridHeaderData = class(TDataModule)
    cdsGridHeader: TClientDataSet;
    cdsGridHeaderProjectName: TWideStringField;
    cdsGridHeaderDealCode: TWideStringField;
    cdsGridHeaderCName: TWideStringField;
    cdsGridHeaderSName: TWideStringField;
    cdsGridHeaderPhaseIndex: TWideStringField;
    cdsGridHeaderDealName: TWideStringField;
    cdsGridHeaderFlowIndex: TIntegerField;
  private
  public
    function AssginData(AProjectData: TProjectData): TDataSet;
  end;

implementation

uses ProjectProperty;

{$R *.dfm}

{ TrmGridHeaderData }

function TrmGridHeaderData.AssginData(
  AProjectData: TProjectData): TDataSet;
begin
  cdsGridHeader.Active := True;
  cdsGridHeader.EmptyDataSet;
  cdsGridHeader.Append;
  cdsGridHeaderProjectName.AsString := AProjectData.ProjProperties.ProjectName;
  cdsGridHeaderDealCode.AsString := AProjectData.ProjProperties.DealIndex;
  cdsGridHeaderCName.AsString := AProjectData.ProjProperties.CName;
  cdsGridHeaderSName.AsString := AProjectData.ProjProperties.SName;
  cdsGridHeaderPhaseIndex.AsString := Format('%d ĘŚ', [AProjectData.PhaseIndex]);
  cdsGridHeaderDealName.AsString := AProjectData.ProjProperties.DealName;
  cdsGridHeaderFlowIndex.AsInteger := 0;
  cdsGridHeader.Post;
  Result := cdsGridHeader;
end;

end.
