unit U_ClothInfoLog;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
  cxEdit, DB, cxDBData, cxCalendar, cxDropDownEdit, ComCtrls, ToolWin,
  cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
  cxClasses, cxControls, cxGridCustomView, cxGrid, cxGridCustomPopupMenu,
  cxGridPopupMenu, ADODB, DBClient, cxButtonEdit, cxTextEdit, StdCtrls, ExtCtrls,
  cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxDateRanges,
  dxBarBuiltInMenu, U_BaseInput, System.ImageList, Vcl.ImgList, cxCheckBox, cxPC,
  dxScrollbarAnnotations, dxSkinsCore, dxSkinsDefaultPainters, cxImageList;

type
  TfrmClothInfoLog = class(TfrmBaseInput)
    ToolBar1: TToolBar;
    TBClose: TToolButton;
    DS_1: TDataSource;
    CDS_Sub: TClientDataSet;
    ADOQueryCmd: TADOQuery;
    ADOQueryMain: TADOQuery;
    ADOQueryTemp: TADOQuery;
    GPM_1: TcxGridPopupMenu;
    ToolButton1: TToolButton;
    cxGrid1: TcxGrid;
    Tv1: TcxGridDBTableView;
    v1SSel: TcxGridDBColumn;
    v1Column12: TcxGridDBColumn;
    v1CYNo: TcxGridDBColumn;
    v1Column9: TcxGridDBColumn;
    Tv1Column24: TcxGridDBColumn;
    v1Column3: TcxGridDBColumn;
    v1Column1: TcxGridDBColumn;
    Tv1Column8: TcxGridDBColumn;
    Tv1Column2: TcxGridDBColumn;
    Tv1Column4: TcxGridDBColumn;
    Tv1Column1: TcxGridDBColumn;
    Tv1Column10: TcxGridDBColumn;
    v1Column11: TcxGridDBColumn;
    Tv1Column5: TcxGridDBColumn;
    Tv1Column9: TcxGridDBColumn;
    Tv1Column6: TcxGridDBColumn;
    Tv1Column7: TcxGridDBColumn;
    Tv1Column11: TcxGridDBColumn;
    Tv1Column13: TcxGridDBColumn;
    Tv1Column23: TcxGridDBColumn;
    Tv1Column3: TcxGridDBColumn;
    Tv1Column12: TcxGridDBColumn;
    Tv1Column14: TcxGridDBColumn;
    Tv1Column15: TcxGridDBColumn;
    Tv1Column16: TcxGridDBColumn;
    Tv1Column17: TcxGridDBColumn;
    Tv1Column18: TcxGridDBColumn;
    Tv1Column22: TcxGridDBColumn;
    Tv1Column19: TcxGridDBColumn;
    Tv1Column20: TcxGridDBColumn;
    Tv1Column21: TcxGridDBColumn;
    cxGrid1Level1: TcxGridLevel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure TBCloseClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure ToolButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    FBCIID: string;
  end;

var
  frmClothInfoLog: TfrmClothInfoLog;

implementation

uses
  U_DataLink, U_RTFun;

{$R *.dfm}

procedure TfrmClothInfoLog.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  inherited;
  Action := caFree;
end;

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

procedure TfrmClothInfoLog.FormShow(Sender: TObject);
begin
  inherited;
  ReadCxGrid(trim(self.Caption), Tv1, '贸易汇总仓库');

  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add(' select A.* ');
    sql.Add(' from BS_Cloth_INFO_log A');
    sql.Add(' where BCIID=''' + Trim(FBCIID) + '''');
    Open;
  end;
  SCreateCDS(ADOQueryTemp, CDS_Sub);
  SInitCDSData(ADOQueryTemp, CDS_Sub);
end;

procedure TfrmClothInfoLog.ToolButton1Click(Sender: TObject);
begin
  WriteCxGrid(trim(self.Caption), Tv1, '贸易汇总仓库');
end;

end.

