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

📄 newsrrb.pas

📁 集成酒店桑拿食管管理的完整程序
💻 PAS
字号:
unit newsrrb;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, StdCtrls, Buttons, ComCtrls, Grids, DBGrids, ExtCtrls;

type
  TnewsrrbForm = class(TForm)
    Panel1: TPanel;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    DateTimePicker1: TDateTimePicker;
    StoredProc1: TStoredProc;
    Table1: TTable;
    Panel2: TPanel;
    DateTimePicker2: TDateTimePicker;
    BitBtn1: TBitBtn;
    Label1: TLabel;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    Animate1: TAnimate;
    BitBtn4: TBitBtn;
    Query1: TQuery;
    BitBtn5: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  newsrrbForm: TnewsrrbForm;

implementation

uses newSrrbprin,dataproc;

{$R *.DFM}

procedure TnewsrrbForm.BitBtn1Click(Sender: TObject);
var ns:string;
begin
    Animate1.Active:=true;
    table1.Active:=false;
{    fm.Query2.Active:=false;
    fm.Query2.SQL.Clear;
    fm.Query2.SQL.Add('select NsTime from syssetup');
    fm.Query2.Open;
    ns:=fm.Query2.Fields[0].AsString;
    fm.Query2.Active:=false;
    fm.Query2.SQL.Clear;  }
    ns:='00';
    StoredProc1.Prepare;
    StoredProc1.ParamByName('@lsbegtime').asdatetime:=strtodatetime(formatdatetime('yyyy-mm-dd',DateTimePicker2.Date)+' '+ns+':00:00');
    StoredProc1.ParamByName('@lsendtime').asdatetime:=strtodatetime(formatdatetime('yyyy-mm-dd',DateTimePicker1.Date)+' '+ns+':00:00');
    StoredProc1.Prepare;
    StoredProc1.ExecProc;
    table1.Open;
    Animate1.Active:=false;
    DBGrid1.Fields[0].Visible:=false;
    DBGrid1.Fields[6].Visible:=false;
    DBGrid1.Fields[0].DisplayWidth:=20;
    DBGrid1.Fields[1].DisplayWidth:=14;
    DBGrid1.Fields[2].DisplayWidth:=14;
    DBGrid1.Fields[3].DisplayWidth:=10;
    DBGrid1.Fields[4].DisplayWidth:=10;
    DBGrid1.Fields[5].DisplayWidth:=10;
    DBGrid1.Fields[0].DisplayLabel:='  ';
    DBGrid1.Fields[1].DisplayLabel:='  累计应收';
    DBGrid1.Fields[2].DisplayLabel:='  累计实收';
    DBGrid1.Fields[3].DisplayLabel:='  当日应收';
    DBGrid1.Fields[4].DisplayLabel:='  当日实收';
    DBGrid1.Fields[5].DisplayLabel:='  其中:免费';

end;

procedure TnewsrrbForm.BitBtn3Click(Sender: TObject);
begin
  close;
end;

procedure TnewsrrbForm.BitBtn2Click(Sender: TObject);
begin
    if not table1.Active then exit;
     application.CreateForm(Tnewsrrbprinform,newsrrbprinform);
     newsrrbprinform.QRLabel1.Caption:=Panel1.Caption;
     newsrrbprinform.QRLabel1.Font:=Panel1.Font;
     newsrrbprinform.QRLabel1.Left:=strtoint(floattostr(int((newsrrbprinform.QRBand1.Width-newsrrbprinform.QRLabel1.Width)/2)));
     newsrrbprinform.QRLabel23.Caption:=formatdatetime('yyyy''年''m''月''d''日''',DateTimePicker1.date);
     newsrrbprinform.QRLabel23.Left:=strtoint(floattostr(int((newsrrbprinform.QRBand1.Width-newsrrbprinform.QRLabel23.Width)/2)));

     newsrrbprinform.hide;
     newsrrbprinform.QR1.print;
     newsrrbprinform.Close;
     newsrrbprinform.free;

end;

procedure TnewsrrbForm.BitBtn4Click(Sender: TObject);
begin
    if not table1.Active then exit;
     application.CreateForm(Tnewsrrbprinform,newsrrbprinform);
     newsrrbprinform.QRLabel1.Caption:=Panel1.Caption;
     newsrrbprinform.QRLabel1.Font:=Panel1.Font;
     newsrrbprinform.QRLabel1.Left:=strtoint(floattostr(int((newsrrbprinform.QRBand1.Width-newsrrbprinform.QRLabel1.Width)/2)));
     newsrrbprinform.QRLabel23.Caption:=formatdatetime('yyyy''年''m''月''d''日''',DateTimePicker1.date);
     newsrrbprinform.QRLabel23.Left:=strtoint(floattostr(int((newsrrbprinform.QRBand1.Width-newsrrbprinform.QRLabel23.Width)/2)));

     newsrrbprinform.hide;
     newsrrbprinform.QR1.preview;//print;
     newsrrbprinform.Close;
     newsrrbprinform.free;

end;

procedure TnewsrrbForm.FormShow(Sender: TObject);
begin
   DateTimePicker1.DateTime:=now;
   DateTimePicker2.DateTime:=strtodatetime(formatdatetime('yyyy',now)+'-01-01 00:00:00');
end;

end.

⌨️ 快捷键说明

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