📄 vilueinfor.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "VilueInfor.h"
#include "DataMoudle.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TVilueInforForm *VilueInforForm;
//---------------------------------------------------------------------------
__fastcall TVilueInforForm::TVilueInforForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TVilueInforForm::FormClose(TObject *Sender,
TCloseAction &Action)
{
Action=caFree;
}
//---------------------------------------------------------------------------
void __fastcall TVilueInforForm::FormShow(TObject *Sender)
{
DateTimePicker1->DateTime=Now();
DateTimePicker2->DateTime=Now();
DateTimePicker3->DateTime=Now();
RadioButton1->Checked=true;
}
//---------------------------------------------------------------------------
void __fastcall TVilueInforForm::RadioButton3Click(TObject *Sender)
{
Label2->Visible=true;
Label3->Visible=true;
Label4->Visible=true;
DateTimePicker2->Visible=true;
DateTimePicker3->Visible=true;
DateTimePicker1->DateTime=Now();
}
//---------------------------------------------------------------------------
void __fastcall TVilueInforForm::RadioButton1Click(TObject *Sender)
{
Label2->Visible=false;
Label3->Visible=false;
Label4->Visible=false;
DateTimePicker3->Visible=false;
DateTimePicker2->Visible=false;
/* ////////////////////////////计算出营业合记
AnsiString SQL;
SQL="select a.orderno ,a.customid ,sum(b.needkmoney)as 'total' from orders a,roomorder b where a.orderno=b.orderno and a.used=1 and checked=1 and a.endtime>="+QuotedStr(DateTimePicker1->DateTime.DateString())+"and a.endtime<"+QuotedStr(DateTimePicker1->DateTime)+"group by a.orderno ,a.customid ,a.customid";
ADOQuerySum->Active=false;
ADOQuerySum->SQL->Clear();
ADOQuerySum->SQL->Add(SQL);
ADOQuerySum->Active=true;
int All;
All=0;
while(!ADOQuerySum->Eof)
{
All+=ADOQuerySum->FieldByName("total")->AsInteger;
ADOQuerySum->Next();
}
Edit1->Text=IntToStr(All);
*/
AnsiString SQL;
SQL="select * from orders where endtime>="+QuotedStr(DateTimePicker1->DateTime.DateString())+"and endtime<"+QuotedStr(DateTimePicker1->DateTime)+"and checked=1";
ADOQueryOrder->Active=false;
ADOQueryOrder->SQL->Clear();
ADOQueryOrder->SQL->Add(SQL);
ADOQueryOrder->Open();
ADOQueryCost->Active=true;
int All;
All=0;
while(!ADOQueryOrder->Eof)
{
All+=ADOQueryOrder->FieldByName("totalcost")->AsInteger;
ADOQueryOrder->Next();
}
Edit1->Text=IntToStr(All);
}
//---------------------------------------------------------------------------
void __fastcall TVilueInforForm::DateTimePicker3Change(TObject *Sender)
{
AnsiString SQL;
SQL="select * from orders where endtime>="+QuotedStr(DateTimePicker2->DateTime.DateString())+"and endtime<"+QuotedStr(DateTimePicker3->DateTime.DateString())+"and checked=1";
ADOQueryOrder->Active=false;
ADOQueryOrder->SQL->Clear();
ADOQueryOrder->SQL->Add(SQL);
ADOQueryOrder->Open();
ADOQueryCost->Active=true;
int All;
All=0;
while(!ADOQueryOrder->Eof)
{
All+=ADOQueryOrder->FieldByName("totalcost")->AsInteger;
ADOQueryOrder->Next();
}
Edit1->Text=IntToStr(All);
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -