unit U_OrderJDNote;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ToolWin, cxStyles, cxCustomData, cxGraphics, cxFilter,
  cxData, cxDataStorage, cxEdit, DB, cxDBData, cxCalendar,
  cxGridCustomPopupMenu, cxGridPopupMenu, DBClient, cxGridLevel,
  cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
  cxControls, cxGridCustomView, cxGrid, ADODB;

type
  TfrmOrderJDNote = class(TForm)
    ToolBar1: TToolBar;
    TBClose: TToolButton;
    cxGrid3: TcxGrid;
    Tv3: TcxGridDBTableView;
    cxGridDBColumn4: TcxGridDBColumn;
    cxGridDBColumn5: TcxGridDBColumn;
    cxGridLevel2: TcxGridLevel;
    DataSource3: TDataSource;
    ClientDataSet3: TClientDataSet;
    cxGridPopupMenu3: TcxGridPopupMenu;
    ADOQuerySub: TADOQuery;
    procedure TBCloseClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
    procedure InitATGrid();
  public
    { Public declarations }
    FMainId,FTTYpe:string;
  end;

var
  frmOrderJDNote: TfrmOrderJDNote;

implementation
Uses
  U_DataLink,U_RTFun;

{$R *.dfm}

procedure TfrmOrderJDNote.InitATGrid();
begin
  with ADOQuerySub do
  begin
    Close;
    sql.Clear;
    sql.Add('select * from JYOrderJD_Main_Att where Mainid='''+Trim(FMainId)+'''');
    sql.Add(' and ATType='''+Trim(FTTYpe)+'''');
    Open;
  end;
  SCreateCDS20(ADOQuerySub,ClientDataSet3);
  SInitCDSData20(ADOQuerySub,ClientDataSet3);
end;

procedure TfrmOrderJDNote.TBCloseClick(Sender: TObject);
begin
  Close;
end;

procedure TfrmOrderJDNote.FormShow(Sender: TObject);
begin
  InitATGrid();
end;

end.
