Unit3.pas
资源名称:HIS.rar [点击查看]
上传用户:fjdqny
上传日期:2016-10-26
资源大小:6299k
文件大小:3k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Unit3;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Grids, DBGrids, StdCtrls, DB, ADODB;
- type
- TForm3 = class(TForm)
- Label1: TLabel;
- Edit1: TEdit;
- Label2: TLabel;
- Label3: TLabel;
- Edit2: TEdit;
- Edit3: TEdit;
- Label4: TLabel;
- Edit4: TEdit;
- Label5: TLabel;
- Edit5: TEdit;
- Label6: TLabel;
- Button1: TButton;
- Button2: TButton;
- Label7: TLabel;
- Edit7: TEdit;
- Label8: TLabel;
- Edit8: TEdit;
- Label9: TLabel;
- Edit9: TEdit;
- Label10: TLabel;
- Label11: TLabel;
- Label12: TLabel;
- Button3: TButton;
- Button4: TButton;
- DBGrid1: TDBGrid;
- DataSource1: TDataSource;
- ADOConnection1: TADOConnection;
- ADOQuery1: TADOQuery;
- ComboBox1: TComboBox;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form3: TForm3;
- Chano,Patno,Pat,Doc,Chaitem,Chasum:Char;
- implementation
- {$R *.dfm}
- procedure TForm3.Button1Click(Sender: TObject);
- begin
- if (Edit1.Text<>'') and (Edit2.text<>'') then
- begin
- // adoquery1.Open;
- adoquery1.SQL.Clear;
- adoquery1.SQL.Add('insert into shoufeidan(Chano,Patno,Pat,Doc,Chaitem,Chasum) values(:Chano,:Patno,:Pat,:Doc,:Chaitem,:Chasum)');
- adoquery1.Parameters.ParamByName('Chano').Value:=Edit1.Text;
- adoquery1.Parameters.ParamByName('Patno').Value:=Edit2.Text;
- adoquery1.Parameters.ParamByName('Pat').Value:=Edit3.Text;
- adoquery1.Parameters.ParamByName('Doc').Value:=Edit4.Text;
- adoquery1.Parameters.ParamByName('Chaitem').Value:=ComboBox1.Text;
- adoquery1.Parameters.ParamByName('Chasum').Value:=strtoint(Edit5.Text);
- adoquery1.ExecSQL;
- adoquery1.Close;
- adoquery1.SQL.Clear;
- adoquery1.SQL.Add('select Chaitem,Chasum from shoufeidan where Chano='''+edit1.Text+'''');
- adoquery1.Open;
- ComboBox1.Text:='';
- showmessage('数据已经添加成功!');
- end
- else
- if (Edit1.Text='') then
- showmessage('请输入收费单编号!')
- else
- if (Edit2.Text='') then
- showmessage('请输入病人编号!');
- end;
- procedure TForm3.Button2Click(Sender: TObject);
- begin
- edit5.Clear;
- end;
- procedure TForm3.FormCreate(Sender: TObject);
- begin
- combobox1.Items.Add('中药费');
- combobox1.Items.Add('西药费');
- combobox1.Items.Add('材料费');
- combobox1.Items.Add('化验费');
- combobox1.Items.Add('检查费');
- combobox1.Items.Add('治疗费');
- combobox1.Items.Add('手术费');
- combobox1.Items.Add('输血费');
- combobox1.Items.Add('输氧费');
- combobox1.Items.Add('B超费');
- combobox1.Items.Add('CT费');
- combobox1.Items.Add('其他');
- end;
- procedure TForm3.Button3Click(Sender: TObject);
- begin
- if (Edit7.Text='') then
- showmessage('请输入收费金额!')
- else
- edit7.Clear; edit8.Clear; edit9.Clear;
- end;
- procedure TForm3.Button4Click(Sender: TObject);
- begin
- form3.Close;
- end;
- end.