f_gzrl.pas
上传用户:lcqxtx
上传日期:2013-02-15
资源大小:530k
文件大小:5k
- unit f_gzrl;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Mask, DBCtrls, DB, ExtCtrls, ADODB, Buttons;
- type
- Tw_gzrl = class(TForm)
- ado_gzxt: TADOQuery;
- data_gzxt: TDataSource;
- Panel1: TPanel;
- StaticText1: TStaticText;
- GroupBox1: TGroupBox;
- ado_gzxtg_nf: TStringField;
- ado_gzxtg_yf: TStringField;
- ado_gzxtrs_id: TStringField;
- ado_gzxtrs_name: TStringField;
- ado_gzxtg_jbgz: TFloatField;
- ado_gzxtg_fdgz: TFloatField;
- ado_gzxtg_grss: TFloatField;
- ado_gzxtg_gwgz: TFloatField;
- ado_gzxtg_shbz: TFloatField;
- ado_gzxtg_bxkc: TFloatField;
- ado_gzxtg_zgz: TFloatField;
- ado_gzxtg_zkc: TFloatField;
- ado_gzxtg_sfgz: TFloatField;
- Label1: TLabel;
- DBEdit1: TDBEdit;
- Label2: TLabel;
- DBEdit2: TDBEdit;
- Label3: TLabel;
- DBEdit3: TDBEdit;
- Label4: TLabel;
- DBEdit4: TDBEdit;
- Label5: TLabel;
- DBEdit5: TDBEdit;
- Label6: TLabel;
- DBEdit6: TDBEdit;
- Label7: TLabel;
- DBEdit7: TDBEdit;
- Label8: TLabel;
- DBEdit8: TDBEdit;
- Label9: TLabel;
- DBEdit9: TDBEdit;
- Label10: TLabel;
- DBEdit10: TDBEdit;
- Label11: TLabel;
- DBEdit11: TDBEdit;
- Label12: TLabel;
- DBEdit12: TDBEdit;
- GroupBox2: TGroupBox;
- Button8: TButton;
- Button1: TButton;
- BitBtn1: TBitBtn;
- Button6: TButton;
- Button5: TButton;
- Button4: TButton;
- Button7: TButton;
- Button3: TButton;
- Button2: TButton;
- Edit1: TEdit;
- Edit3: TEdit;
- Label14: TLabel;
- DBEdit13: TDBEdit;
- Edit2: TEdit;
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure Button7Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- procedure Button5Click(Sender: TObject);
- procedure Button6Click(Sender: TObject);
- procedure Button8Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure ado_gzxtCalcFields(DataSet: TDataSet);
- procedure FormShow(Sender: TObject);
- procedure BitBtn1Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- w_gzrl: Tw_gzrl;
- implementation
- uses f_main;
- {$R *.dfm}
- procedure Tw_gzrl.Button2Click(Sender: TObject);
- begin
- try
- dbedit1.text:='';
- dbedit2.text:='';
- dbedit3.text:='';
- dbedit4.text:='';
- dbedit5.text:='';
- dbedit6.text:='';
- dbedit7.text:='';
- dbedit8.text:='';
- dbedit9.text:='';
- dbedit10.text:='';
- dbedit11.text:='';
- dbedit12.text:='';
- edit1.Text:='';
- edit2.Text:='' ;
- edit3.Text :='';
- ado_gzxt.Append;
- except
- application.MessageBox('与管理联系!','提示',mb_ok+mb_iconinformation);
- end;
- end;
- procedure Tw_gzrl.Button3Click(Sender: TObject);
- begin
- ado_gzxt.Edit;
- ado_gzxt.Post;
- showmessage('数据修改成功!');
- edit1.Text:='';
- edit2.Text:='' ;
- edit3.Text :='';
- end;
- procedure Tw_gzrl.Button7Click(Sender: TObject);
- begin
- if ado_gzxt.Modified then
- ado_gzxt.Post;
- end;
- procedure Tw_gzrl.Button4Click(Sender: TObject);
- begin
- ado_gzxt.Prior;
- edit1.Text:='';
- edit2.Text:='' ;
- edit3.Text :='';
- end;
- procedure Tw_gzrl.Button5Click(Sender: TObject);
- begin
- ado_gzxt.Next;
- edit1.Text:='';
- edit2.Text:='' ;
- edit3.Text :='';
- end;
- procedure Tw_gzrl.Button6Click(Sender: TObject);
- begin
- ado_gzxt.First;
- showmessage('当前是第一条记录');
- edit1.Text:='';
- edit2.Text:='' ;
- edit3.Text :='';
- end;
- procedure Tw_gzrl.Button8Click(Sender: TObject);
- begin
- ado_gzxt.Next;
- showmessage('当前是第一条记录');
- edit1.Text:='';
- edit2.Text:='' ;
- edit3.Text :='';
- end;
- procedure Tw_gzrl.Button1Click(Sender: TObject);
- begin
- edit1.Text:=dbedit11.Text;
- edit2.Text:=dbedit13.text;
- edit3.Text:=dbedit12.Text;
- end;
- procedure Tw_gzrl.ado_gzxtCalcFields(DataSet: TDataSet);
- begin
- ado_gzxtg_zgz.Value:=ado_gzxtg_jbgz.Value+ado_gzxtg_fdgz.Value+ado_gzxtg_shbz.Value;
- //ado_gzxtg_bxkc.Value:=ado_gzxtg_jbgz.Value*0.2;
- // ado_gzxtg_grss.Value:=ado_gzxtg_jbgz.Value*0.03;
- ado_gzxtg_zkc.Value:= ado_gzxtg_bxkc.Value+ado_gzxtg_grss.Value;
- ado_gzxtg_sfgz.Value:=ado_gzxtg_zgz.Value-ado_gzxtg_bxkc.Value-ado_gzxtg_grss.Value;
- end;
- procedure Tw_gzrl.FormShow(Sender: TObject);
- begin
- //ado_gzxt.Refresh ;
- //edit1.Text:='';
- ///edit2.Text:='';
- //edit3.Text:='';
- end;
- procedure Tw_gzrl.BitBtn1Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tw_gzrl.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- w_main.Enabled:=true;
- end;
- procedure Tw_gzrl.FormCreate(Sender: TObject);
- begin
- w_main.Enabled:=false;
- end;
- end.