⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit12.~pas

📁 机房管理系统源代码2006-7-8制作的非常实用
💻 ~PAS
字号:
unit Unit12;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons,adodb,dateutils,StrUtils;

type
  Tfrmsuemath = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    Label4: TLabel;
    Edit4: TEdit;
    Label5: TLabel;
    Edit5: TEdit;
    Label6: TLabel;
    Edit6: TEdit;
    BitBtn1: TBitBtn;
    procedure FormShow(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
    tys:integer;
  public
    { Public declarations }
    property ty:integer read tys write tys;
  end;

var
  frmsuemath: Tfrmsuemath;

implementation

uses Unit3;

{$R *.dfm}
//********************************
//2004-05-12 qhb
//根据上下机时间,自动读出计费信息
//********************************
procedure Tfrmsuemath.FormShow(Sender: TObject);
var
  qu:tadoquery;
  
  //money:string;
begin
 if tys=1 then
 begin
   frmsuemath.Caption:='个人上机';
   qu:=tadoquery.Create(nil);
   qu.Connection:=dm1.ADOCon1;
   qu.SQL.Text:='select * from operates where st_id='''
    +trim(edit1.Text)+'''';
   qu.Open;
   edit2.text:=qu.fieldbyname('cash').AsString;
   qu.close;
   qu.free;
   edit5.Text:=timetostr(time);

 // s:=SecondsBetween(formatdatetime('tt',now),formatdatetime('tt',strtotime(edit3.Text)))/100;
   edit4.Text:=floattostr(SecondsBetween(time,strtotime(edit3.Text))/6000);
 //  StrToCurr(Format('%100.2f',edit4.text));
   edit4.text:=floattostr(round(strtofloat(edit4.Text)*100)/100);
   edit6.Text:=floattostr(strtofloat(edit2.Text)-strtofloat(edit4.Text));
 end;
 if tys=2 then
   frmsuemath.Caption:='下机情况';
end;
//*******************************
//2004-05-12 qhb
//刷新金额   operates表中cash数据
//*******************************
procedure Tfrmsuemath.BitBtn1Click(Sender: TObject);
var   qu:tadoquery;
begin
   qu:=tadoquery.Create(nil);
   qu.Connection:=dm1.ADOCon1;
   qu.SQL.Text:='update operates set cash='''+trim(edit6.Text)+'''where st_id='''
    +trim(edit1.Text)+'''';
   qu.execsql;
   qu.close;
   qu.free;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -