📄 cw_kdskdx.~pas
字号:
unit cw_kdskdx;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids, DB, DBTables, Mask, DBCtrls;
type
TForm37 = class(TForm)
Label1: TLabel;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
Q_kdry: TQuery;
ds_kdry: TDataSource;
DBGrid1: TDBGrid;
Q_kddx: TQuery;
ds_kddx: TDataSource;
DBGrid2: TDBGrid;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
DBText1: TDBText;
DBText2: TDBText;
Button3: TButton;
Label3: TLabel;
Edit2: TEdit;
Button2: TButton;
Label2: TLabel;
Edit1: TEdit;
Button1: TButton;
Button4: TButton;
Q_dxwc: TQuery;
dxje: TEdit;
Q_dxdx: TTable;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure DBGrid1CellClick(Column: TColumn);
procedure Button3Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form37: TForm37;
implementation
uses cw_main;
{$R *.dfm}
procedure TForm37.Button2Click(Sender: TObject);
begin
Q_kdry.Active:=false;
Q_kdry.SQL.Clear;
Q_kdry.SQL.Add('select * from userinfo where username='''+edit2.Text+'''');
Q_kdry.Active:=true;
end;
procedure TForm37.Button1Click(Sender: TObject);
begin
Q_kdry.Active:=false;
Q_kdry.SQL.Clear;
Q_kdry.SQL.Add('select * from userinfo where userno='''+edit1.Text+'''');
Q_kdry.Active:=true;
end;
procedure TForm37.Button4Click(Sender: TObject);
begin
close;
end;
procedure TForm37.DBGrid1CellClick(Column: TColumn);
begin
Q_kddx.Active:=false;
Q_kddx.SQL.Clear;
Q_kddx.SQL.Add('select * from h_kddx where userno='''+dbtext1.Caption+'''');
Q_kddx.Active:=true;
end;
procedure TForm37.Button3Click(Sender: TObject);
var ylje:double;
begin
Q_dxwc.Close;
Q_dxwc.SQL.Clear;
Q_dxwc.SQL.Add('select * from userinfo where userno='''+dbtext1.Caption+'''');
Q_dxwc.Open;
ylje:=Q_dxwc.fieldbyname('totalmoney').AsFloat;
if ylje<strtofloat(trim(dxje.Text)) then
begin
MessageDlg('输入金额错误,请重新输入!',mtError,[mbok],0);
dxje.SetFocus;
end
else
begin
Q_dxwc.Edit;
Q_dxwc['totalmoney']:=Q_dxwc['totalmoney']-strtofloat(trim(dxje.Text));
Q_dxwc.Post;
Q_dxwc.Close;
Q_dxdx.Open;
Q_dxdx.AppendRecord([dbtext1.caption,dbtext2.caption,strtofloat(trim(dxje.Text)),form1.operator.caption,now]);
Q_dxdx.Close;
Q_kddx.active:=false;
Q_kddx.Active:=True;
end;
end;
procedure TForm37.FormShow(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
dxje.Text:='0';
Q_kdry.Active:=false;
Q_kdry.Active:=true;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -