⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cxckxx.~pas

📁 库存管理信息系统 自带数据库 如有什么问题:247848560
💻 ~PAS
字号:
unit cxckxx;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, StdCtrls, Buttons, DB, ADODB, DBGrids;

type
  Tcxckxxfrm = class(TForm)
    GroupBox1: TGroupBox;
    RadioButton1: TRadioButton;
    Edit1: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    RadioButton2: TRadioButton;
    GroupBox2: TGroupBox;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    ADOTable1: TADOTable;
    ADOQuery1: TADOQuery;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  cxckxxfrm: Tcxckxxfrm;

implementation
 uses main;
{$R *.dfm}

procedure Tcxckxxfrm.BitBtn1Click(Sender: TObject);
var  query:string;
begin
if radiobutton1.Checked=true then
   if edit1.Text='' then
    showmessage('请输入相应的查询条件!')
    else
    query:='select * from SELL where sellid='+''''+edit1.Text+'''';
if radiobutton2.Checked=true then
   query:='select * from SELL';
if query<>'' then
  begin
  with adoquery1 do
   begin
   close;
   sql.Clear;
   sql.Add(query);
   open;
   first;
   if recordcount=0 then
     begin
     showmessage('没有符合条件的查询!');
     edit1.SetFocus;
     end
   else
   begin
    dbgrid1.Columns[0].FieldName:='sellid';
    dbgrid1.Columns[1].FieldName:='customerid';
    dbgrid1.Columns[2].FieldName:='customername';
    dbgrid1.Columns[3].FieldName:='depotid';
    dbgrid1.Columns[4].FieldName:='depotname';
    dbgrid1.Columns[5].FieldName:='productid';
    dbgrid1.Columns[6].FieldName:='productname';
    dbgrid1.Columns[7].FieldName:='spec';
     dbgrid1.Columns[8].FieldName:='unit';
    dbgrid1.Columns[9].FieldName:='quantity';
    dbgrid1.Columns[10].FieldName:='unitprice';
    dbgrid1.Columns[11].FieldName:='payment';
    dbgrid1.Columns[12].FieldName:='selldate';
    dbgrid1.Columns[13].FieldName:='sellremark';
    end;
   end;
   end;
end;

procedure Tcxckxxfrm.BitBtn2Click(Sender: TObject);
begin
mainfrm.Show;
cxckxxfrm.Hide;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -