unit U_MarketValueSel; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls, U_BaseHelp, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList, StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu, System.ImageList, U_BaseInput, cxButtonEdit, cxDropDownEdit, cxCheckBox, Vcl.Menus, dxSkinWXI, dxScrollbarAnnotations, dxSkinBasic, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkroom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark, dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray, dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine, dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue; type TfrmMarketValueSel = class(TfrmBaseHelp) ToolBar1: TToolBar; ADOQueryMain: TADOQuery; ADOQueryTemp: TADOQuery; ADOQueryCmd: TADOQuery; DS_1: TDataSource; CDS_1: TClientDataSet; TBSave: TToolButton; TBClose: TToolButton; ToolButton1: TToolButton; ADOConnection1: TADOConnection; Panel1: TPanel; GPM_1: TcxGridPopupMenu; ImageList1: TImageList; cxStyleRepository1: TcxStyleRepository; cxStyle1: TcxStyle; ThreeColorBase: TcxStyleRepository; SHuangSe: TcxStyle; SkyBlue: TcxStyle; Default: TcxStyle; QHuangSe: TcxStyle; Red: TcxStyle; FontBlue: TcxStyle; TextSHuangSe: TcxStyle; FonePurple: TcxStyle; FoneClMaroon: TcxStyle; FoneRed: TcxStyle; RowColor: TcxStyle; handBlack: TcxStyle; cxBlue: TcxStyle; SHuangSeCu: TcxStyle; PM_1: TPopupMenu; N1: TMenuItem; N2: TMenuItem; Label2: TLabel; C_Name: TEdit; Label3: TLabel; BuyName: TEdit; Label4: TLabel; GC_Name: TEdit; cxGrid1: TcxGrid; Tv1: TcxGridDBTableView; Tv1Column7: TcxGridDBColumn; VC_SCSCode: TcxGridDBColumn; v1Column4: TcxGridDBColumn; Tv1Column3: TcxGridDBColumn; v1Column5: TcxGridDBColumn; v1Column1: TcxGridDBColumn; Tv1Column14: TcxGridDBColumn; Tv1Column4: TcxGridDBColumn; Tv1Column5: TcxGridDBColumn; Tv1Column13: TcxGridDBColumn; v1Column8: TcxGridDBColumn; Tv1Column1: TcxGridDBColumn; Tv1Column8: TcxGridDBColumn; v1Column6: TcxGridDBColumn; v1Column7: TcxGridDBColumn; Tv1Column15: TcxGridDBColumn; Tv1Column19: TcxGridDBColumn; Tv1Column16: TcxGridDBColumn; Tv1Column17: TcxGridDBColumn; Tv1Column18: TcxGridDBColumn; v1PRTPrice: TcxGridDBColumn; v1OrderUnit: TcxGridDBColumn; v1Column2: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; Tv1Column6: TcxGridDBColumn; Tv1Column9: TcxGridDBColumn; Tv1Column12: TcxGridDBColumn; Tv1Column10: TcxGridDBColumn; Tv1Column11: TcxGridDBColumn; cxGrid1Level1: TcxGridLevel; Tv1Column20: TcxGridDBColumn; Tv1Column21: TcxGridDBColumn; Tv1Column22: TcxGridDBColumn; Tv1Column23: TcxGridDBColumn; Tv1Column24: TcxGridDBColumn; Tv1Column25: TcxGridDBColumn; Tv1Column26: TcxGridDBColumn; Tv1Column27: TcxGridDBColumn; Tv1Column28: TcxGridDBColumn; Tv1Column29: TcxGridDBColumn; Tv1Column30: TcxGridDBColumn; Tv1Column31: TcxGridDBColumn; Tv1Column32: TcxGridDBColumn; Tv1Column33: TcxGridDBColumn; Tv1Column34: TcxGridDBColumn; Label1: TLabel; Label5: TLabel; CraftCode: TEdit; MVCNo: TEdit; procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure ToolButton1Click(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure TBSaveClick(Sender: TObject); procedure TV1DblClick(Sender: TObject); procedure TBCloseClick(Sender: TObject); procedure N1Click(Sender: TObject); procedure N2Click(Sender: TObject); procedure ConNoChange(Sender: TObject); private procedure InitGrid(); { Private declarations } public FCoType, FAuthority, FConNo, FC_Code: string; { Public declarations } end; var frmMarketValueSel: TfrmMarketValueSel; implementation uses U_DataLink, U_RTFun; {$R *.dfm} procedure TfrmMarketValueSel.FormCreate(Sender: TObject); begin inherited; try with ADOConnection1 do begin Connected := false; ConnectionString := DConString; Connected := true; end; ADOQueryBaseCmd.Connection := ADOConnection1; ADOQueryBaseTemp.Connection := ADOConnection1; except application.MessageBox('网络连接失败!', '提示信息'); end; end; procedure TfrmMarketValueSel.ConNoChange(Sender: TObject); begin if ADOQueryMain.Active = False then Exit; SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); SCreateCDS(ADOQueryMain, CDS_1); SInitCDSData(ADOQueryMain, CDS_1); end; procedure TfrmMarketValueSel.FormClose(Sender: TObject; var Action: TCloseAction); begin BuyName.SetFocus; Action := cahide; end; procedure TfrmMarketValueSel.InitGrid(); begin try ADOQueryMain.DisableControls; with ADOQueryMain do begin Close; sql.Clear; sql.Add(' SELECT * FROM MV_Cloth_Main A LEFT JOIN MV_Cloth_Sub B ON A.MVCMId=B.MVCMId '); sql.Add(' WHERE MVCType=''报价'' '); Open; end; SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); SCreateCDS(ADOQueryMain, CDS_1); SInitCDSData(ADOQueryMain, CDS_1); finally ADOQueryMain.EnableControls; end; end; procedure TfrmMarketValueSel.N1Click(Sender: TObject); begin SelOKNo(CDS_1, True); end; procedure TfrmMarketValueSel.N2Click(Sender: TObject); begin SelOKNo(CDS_1, False); end; procedure TfrmMarketValueSel.FormShow(Sender: TObject); begin inherited; InitGrid(); ReadCxGrid(Trim(self.Caption), TV1, '自定义数据'); end; procedure TfrmMarketValueSel.TBCloseClick(Sender: TObject); begin inherited; Close; end; procedure TfrmMarketValueSel.TBSaveClick(Sender: TObject); begin WriteCxGrid(Trim(self.Caption), TV1, '自定义数据'); end; procedure TfrmMarketValueSel.ToolButton1Click(Sender: TObject); begin BuyName.SetFocus; ModalResult := 1; end; procedure TfrmMarketValueSel.TV1DblClick(Sender: TObject); begin ModalResult := 1; end; procedure TfrmMarketValueSel.FormDestroy(Sender: TObject); begin inherited; frmMarketValueSel := nil; end; end.