am_Sdqcs.~pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:3k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit am_Sdqcs;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, StdCtrls, Grids, DBGridEh, Buttons, DB, DBClient;
- type
- Tam_Sdqc = class(TForm)
- Panel1: TPanel;
- Panel2: TPanel;
- Edit1: TEdit;
- Panel3: TPanel;
- DBGridEh1: TDBGridEh;
- SpeedButton1: TSpeedButton;
- SpeedButton2: TSpeedButton;
- ClientDataSet1: TClientDataSet;
- DataSource1: TDataSource;
- procedure SpeedButton1Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure SpeedButton2Click(Sender: TObject);
- procedure DBGridEh1CellClick(Column: TColumnEh);
- procedure Edit1KeyPress(Sender: TObject; var Key: Char);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- am_Sdqc: Tam_Sdqc;
- implementation
- uses ajgl_bjs,u_public, Am_wjbjs;
- {$R *.dfm}
- procedure Tam_Sdqc.SpeedButton1Click(Sender: TObject);
- var s:string;
- begin
- s:=edit1.Text;
- Clientdataset1.Close;
- clientdataset1.CommandText:='select * from sz_ztck where ztck_ztc='+''''+s+''''+'';
- Clientdataset1.Open;
- if frm_name='am_ajgl_bj' then
- begin
- if (trim(am_ajgl_bj.DBEditEh9.Text)='') then
- begin
- am_ajgl_bj.DBEditEh9.Text:=dbgrideh1.Columns[0].DisplayText;
- close;
- end
- else
- begin
- am_ajgl_bj.DBEditEh9.Text:=am_ajgl_bj.DBEditEh9.Text+','+dbgrideh1.Columns[0].DisplayText;
- Close;
- end;
- end
- //---
- else
- if frm_name='am_Wjgl_bj' then
- begin
- if (trim(am_wjgl_bj.DBEditEh3.Text)='') then
- begin
- am_wjgl_bj.DBEditEh3.Text:=dbgrideh1.Columns[0].DisplayText;
- close;
- end
- else
- begin
- am_wjgl_bj.DBEditEh3.Text:=am_wjgl_bj.DBEditEh3.Text+','+dbgrideh1.Columns[0].DisplayText;
- Close;
- end;
- end;
- end;
- procedure Tam_Sdqc.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- Clientdataset1.Active:=false;
- action:=cafree;
- am_sdqc:=Nil;
- end;
- procedure Tam_Sdqc.SpeedButton2Click(Sender: TObject);
- begin
- Close;
- end;
- procedure Tam_Sdqc.DBGridEh1CellClick(Column: TColumnEh);
- var s,k:string;
- begin
- s:=edit1.Text;
- k:='ztck_ztc'+' like '+''''+s+'%'+'''';
- Clientdataset1.Close;
- clientdataset1.CommandText:='select * from sz_ztck where '+ k;
- Clientdataset1.Open;
- if frm_name='am_ajgl_bj' then
- begin
- if (trim(am_ajgl_bj.DBEditEh9.Text)='') then
- begin
- am_ajgl_bj.DBEditEh9.Text:=dbgrideh1.Columns[0].DisplayText;
- close;
- end
- else
- begin
- am_ajgl_bj.DBEditEh9.Text:=am_ajgl_bj.DBEditEh9.Text+','+dbgrideh1.Columns[0].DisplayText;
- Close;
- end;
- end
- else
- //---------------
- if frm_name='am_Wjgl_bj' then
- begin
- if (trim(am_wjgl_bj.DBEditEh3.Text)='') then
- begin
- am_wjgl_bj.DBEditEh3.Text:=dbgrideh1.Columns[0].DisplayText;
- close;
- end
- else
- begin
- am_wjgl_bj.DBEditEh3.Text:=am_wjgl_bj.DBEditEh3.Text+','+dbgrideh1.Columns[0].DisplayText;
- Close;
- end;
- end;
- end;
- procedure Tam_Sdqc.Edit1KeyPress(Sender: TObject; var Key: Char);
- var s,k:string;
- begin
- if key=#13 then
- begin
- s:=edit1.Text;
- k:='ztck_ztc'+' like '+''''+s+'%'+'''';
- Clientdataset1.Close;
- clientdataset1.CommandText:='select * from sz_ztck where '+K;
- Clientdataset1.Open;
- end;
- end;
- end.