unit U_JYMXInfo;

interface

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

type
  TfrmJYMXInfo = class(TForm)
    ADOQueryCmd: TADOQuery;
    ADOQueryMain: TADOQuery;
    ADOQueryTemp: TADOQuery;
    DataSource1: TDataSource;
    cxGridPopupMenu1: TcxGridPopupMenu;
    CDS_Main: TClientDataSet;
    cxGrid1: TcxGrid;
    Tv1: TcxGridDBTableView;
    v1Column1: TcxGridDBColumn;
    v1Column33: TcxGridDBColumn;
    v1Column13: TcxGridDBColumn;
    v1Column4: TcxGridDBColumn;
    v1Column2: TcxGridDBColumn;
    v1Column3: TcxGridDBColumn;
    v1Column20: TcxGridDBColumn;
    v1Column21: TcxGridDBColumn;
    v1Column28: TcxGridDBColumn;
    v1Column6: TcxGridDBColumn;
    v1Column23: TcxGridDBColumn;
    v1Column12: TcxGridDBColumn;
    v1Column31: TcxGridDBColumn;
    v1Column32: TcxGridDBColumn;
    v1Column8: TcxGridDBColumn;
    v1Column16: TcxGridDBColumn;
    v1Column9: TcxGridDBColumn;
    v1Column11: TcxGridDBColumn;
    v1Column25: TcxGridDBColumn;
    v1Column7: TcxGridDBColumn;
    v1Column17: TcxGridDBColumn;
    v1Column29: TcxGridDBColumn;
    v1Column30: TcxGridDBColumn;
    v1Column15: TcxGridDBColumn;
    v1Column19: TcxGridDBColumn;
    v1Column24: TcxGridDBColumn;
    v1Column27: TcxGridDBColumn;
    v1Column18: TcxGridDBColumn;
    v1Column26: TcxGridDBColumn;
    v1Column10: TcxGridDBColumn;
    v1Column5: TcxGridDBColumn;
    cxGrid1Level1: TcxGridLevel;
    MovePanel2: TMovePanel;
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
  private
    procedure InitGrid();
    { Private declarations }
  public
    FFMainId,FFClothType:String;
    { Public declarations }
  end;

var
  frmJYMXInfo: TfrmJYMXInfo;

implementation
uses
  U_DataLink,U_Fun;

{$R *.dfm}

procedure TfrmJYMXInfo.FormDestroy(Sender: TObject);
begin
  frmJYMXInfo:=nil;
end;

procedure TfrmJYMXInfo.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  WriteCxGrid('检验信息明细',Tv1,'坯布仓库');
  Action:=caFree;
end;

procedure TfrmJYMXInfo.InitGrid();
begin
  try
    ADOQueryMain.DisableControls;
    with ADOQueryMain do
    begin
      Filtered:=False;
      Close;
      sql.Clear;
      sql.Add('exec P_Viwe_JYInfo_MX :WSql');
      Parameters.ParamByName('WSql').Value:=' and C.MainId='''+Trim(FFMainId)+''' and C.ClothType='''+Trim(FFClothType)+'''' ;     
      Open;
    end;
    SCreateCDS20(ADOQueryMain,CDS_Main);
    SInitCDSData20(ADOQueryMain,CDS_Main);
  finally
    ADOQueryMain.EnableControls;
  end;
end;

procedure TfrmJYMXInfo.FormShow(Sender: TObject);
begin
  ReadCxGrid('检验信息明细',Tv1,'坯布仓库');
  InitGrid();
end;

end.
