unit U_YEYarnPlanSel; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxCalendar, StrUtils, cxDropDownEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges, dxBarBuiltInMenu, U_BaseList, cxCheckBox; type TfrmYEYarnPlanSel = class(Tform) ToolBar1: TToolBar; TBClose: TToolButton; cxGrid1: TcxGrid; Tv1: TcxGridDBTableView; cxGrid1Level1: TcxGridLevel; ADOTemp: TADOQuery; ADOCmd: TADOQuery; DataSource1: TDataSource; Order_Sub: TClientDataSet; ADOQuery1: TADOQuery; cxGridPopupMenu2: TcxGridPopupMenu; cxStyleRepository1: TcxStyleRepository; dazi1: TcxStyle; v1Column2: TcxGridDBColumn; ToolButton4: TToolButton; Tv1Column1: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; Tv1Column3: TcxGridDBColumn; Tv1Column4: TcxGridDBColumn; Tv1Column5: TcxGridDBColumn; Tv1Column6: TcxGridDBColumn; Tv1Column7: TcxGridDBColumn; Tv1Column8: TcxGridDBColumn; Tv1Column9: TcxGridDBColumn; Tv1Column10: TcxGridDBColumn; Tv1Column11: TcxGridDBColumn; Tv1Column12: TcxGridDBColumn; Tv1Column13: TcxGridDBColumn; Tv1Column14: TcxGridDBColumn; ToolButton1: TToolButton; procedure TBCloseClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure ToolButton4Click(Sender: TObject); procedure ToolButton1Click(Sender: TObject); private fuserName: string; procedure InitData(); { Private declarations } public PState, CopyInt: Integer; FDRMID: string; { Public declarations } end; var frmYEYarnPlanSel: TfrmYEYarnPlanSel; newh: hwnd; implementation uses U_DataLink, U_ZDYHelp, U_RTFun, U_CompanySel; {$R *.dfm} procedure TfrmYEYarnPlanSel.TBCloseClick(Sender: TObject); begin Close; end; procedure TfrmYEYarnPlanSel.InitData(); begin with ADOCmd do begin Close; SQL.Clear; sql.Add(' select A.* '); sql.Add(' from YE_Plan_Main A'); Open; end; SCreateCDS(ADOCmd, Order_Sub); SInitCDSData(ADOCmd, Order_Sub); end; procedure TfrmYEYarnPlanSel.FormShow(Sender: TObject); begin readCxGrid(trim(self.Caption), Tv1, '发货管理'); InitData(); end; procedure TfrmYEYarnPlanSel.ToolButton1Click(Sender: TObject); begin if Order_Sub.IsEmpty then Exit; if Order_Sub.Locate('SSel', True, []) = False then begin Application.MessageBox('没有选择数据!', '提示', 0); Exit; end; ModalResult := 1; end; procedure TfrmYEYarnPlanSel.ToolButton4Click(Sender: TObject); begin WriteCxGrid(trim(self.Caption), Tv1, '发货管理') end; end.