📄 unit25.pas
字号:
unit Unit25;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls, ComCtrls;
type
TForm25 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
TabSheet5: TTabSheet;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
DBGrid1: TDBGrid;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
DataSource1: TDataSource;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
Label3: TLabel;
Edit3: TEdit;
Label4: TLabel;
Edit4: TEdit;
Button3: TButton;
Button4: TButton;
DBGrid2: TDBGrid;
ADOQuery2: TADOQuery;
DataSource2: TDataSource;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
Label5: TLabel;
Edit5: TEdit;
Label6: TLabel;
Edit6: TEdit;
Button5: TButton;
Button6: TButton;
DataSource3: TDataSource;
ADOQuery3: TADOQuery;
DBGrid3: TDBGrid;
RadioButton7: TRadioButton;
RadioButton8: TRadioButton;
Label7: TLabel;
Label8: TLabel;
Edit7: TEdit;
Edit8: TEdit;
Button7: TButton;
Button8: TButton;
DBGrid4: TDBGrid;
ADOQuery4: TADOQuery;
DataSource4: TDataSource;
RadioButton9: TRadioButton;
RadioButton10: TRadioButton;
Label9: TLabel;
Label10: TLabel;
Edit9: TEdit;
Edit10: TEdit;
Button9: TButton;
Button10: TButton;
DataSource5: TDataSource;
ADOQuery5: TADOQuery;
DBGrid5: TDBGrid;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form25: TForm25;
Query : TADOQuery;
aaa,bbb,ccc,ddd,eee:Char;
implementation
{$R *.dfm}
procedure TForm25.Button1Click(Sender: TObject);
begin
if (RadioButton1.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Senno from fayaodan where Senno =:aaa');
Query.Parameters.ParamByName('aaa').Value :=edit1.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('发药单信息不存在!')
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select Senno,Patno,Pat,Doc,Med,Su from fayaodan where Senno='''+edit1.Text+'''');
adoquery1.Open;
end
end
else
if(RadioButton2.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Patno from fayaodan where Patno =:aaa');
Query.Parameters.ParamByName('aaa').Value :=edit2.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('病人编号不存在!')
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select Senno,Patno,Pat,Doc,Med,Su from fayaodan where Patno='''+edit2.Text+'''');
adoquery1.Open;
end
end
else
showmessage('请输入发药单号或病人编号!');
end;
procedure TForm25.Button2Click(Sender: TObject);
begin
form25.Close;
end;
procedure TForm25.Button3Click(Sender: TObject);
begin
if (RadioButton3.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Canno from tuiyaodan where Canno =:bbb');
Query.Parameters.ParamByName('bbb').Value :=edit3.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('退药单信息不存在!')
else
begin
adoquery2.Close;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('select Canno,Patno,Pat,Med,Su from tuiyaodan where Canno='''+edit3.Text+'''');
adoquery2.Open;
end
end
else
if(RadioButton4.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Patno from tuiyaodan where Patno =:bbb');
Query.Parameters.ParamByName('bbb').Value :=edit4.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('病人编号不存在!')
else
begin
adoquery2.Close;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('select Canno,Patno,Pat,Med,Su from tuiyaodan where Patno='''+edit4.Text+'''');
adoquery2.Open;
end
end
else
showmessage('请输入退药单号或病人编号!');
end;
procedure TForm25.Button4Click(Sender: TObject);
begin
form25.Close;
end;
procedure TForm25.Button5Click(Sender: TObject);
begin
if (RadioButton5.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Inno from yaofangrukudan where Inno =:ccc');
Query.Parameters.ParamByName('ccc').Value :=edit5.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('入库单信息不存在!')
else
begin
adoquery3.Close;
adoquery3.SQL.Clear;
adoquery3.SQL.Add('select Inno,Druno,Stono,Med,Su from yaofangrukudan where Inno='''+edit5.Text+'''');
adoquery3.Open;
end
end
else
if(RadioButton6.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Druno from yaofangrukudan where Druno =:ccc');
Query.Parameters.ParamByName('ccc').Value :=edit6.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('药房编号不存在!')
else
begin
adoquery3.Close;
adoquery3.SQL.Clear;
adoquery3.SQL.Add('select Inno,Druno,Stono,Med,Su from yaofangrukudan where Druno='''+edit6.Text+'''');
adoquery3.Open;
end
end
else
showmessage('!!!!!!!!!!!!!!!!');
end;
procedure TForm25.Button6Click(Sender: TObject);
begin
form25.Close;
end;
procedure TForm25.Button7Click(Sender: TObject);
begin
if (RadioButton7.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Outno from yaofangchukudan where Outno =:ddd');
Query.Parameters.ParamByName('ddd').Value :=edit7.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('出库单信息不存在!')
else
begin
adoquery4.Close;
adoquery4.SQL.Clear;
adoquery4.SQL.Add('select Outno,Druno,Stono,Med,Su from yaofangchukudan where Outno='''+edit7.Text+'''');
adoquery4.Open;
end
end
else
if(RadioButton8.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Druno from yaofangchukudan where Druno =:ddd');
Query.Parameters.ParamByName('ddd').Value :=edit8.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('药房编号不存在!')
else
begin
adoquery4.Close;
adoquery4.SQL.Clear;
adoquery4.SQL.Add('select Outno,Druno,Stono,Med,Su from yaofangchukudan where Druno='''+edit8.Text+'''');
adoquery4.Open;
end
end
else
showmessage('!!!!!!!!!!!!!!!!');
end;
procedure TForm25.Button8Click(Sender: TObject);
begin
form25.Close;
end;
procedure TForm25.Button9Click(Sender: TObject);
begin
if (RadioButton9.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Stkno from caigoudan where Stkno =:eee');
Query.Parameters.ParamByName('eee').Value :=edit9.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('采购单信息不存在!')
else
begin
adoquery5.Close;
adoquery5.SQL.Clear;
adoquery5.SQL.Add('select Stkno,Buyno,Medno,Med,Su,Uprice from caigoudan where Stkno='''+edit9.Text+'''');
adoquery5.Open;
end
end
else
if(RadioButton10.Checked=true) then
begin
Query := TADOQuery.Create(nil);
Query.Connection :=ADOConnection1;
Query.SQL.Add('select Medno from caigoudan where Medno =:eee');
Query.Parameters.ParamByName('eee').Value :=edit10.Text;
Query.Open;
if Query.RecordCount =0 then //非0表示存在,0表示不存在
showmessage('药品编号不存在!')
else
begin
adoquery5.Close;
adoquery5.SQL.Clear;
adoquery5.SQL.Add('select Stkno,Buyno,Medno,Med,Su,Uprice from caigoudan where Medno='''+edit10.Text+'''');
adoquery5.Open;
end
end
else
showmessage('!!!!!!!!!!!!!!!!');
end;
procedure TForm25.Button10Click(Sender: TObject);
begin
form25.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -