📄 dstatselftel.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "DStatSelfTel.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TDlgStatSelfTel *DlgStatSelfTel;
//---------------------------------------------------------------------------
__fastcall TDlgStatSelfTel::TDlgStatSelfTel( String& SQLStr, TDateTime& BeginDate,
TDateTime& EndDate,TDMTelSys* pDMTelSys, TComponent* Owner)
: SQLStr( SQLStr), BeginDate( BeginDate), EndDate( EndDate), pDMTelSys( pDMTelSys), TForm(Owner)
{
if( pDMTelSys->PhoneQuery->Active == false) {
pDMTelSys->PhoneQuery->Open();
}
pDMTelSys->PhoneQuery->First();
while( !pDMTelSys->PhoneQuery->Eof) {
CBPhone->Items->Add( pDMTelSys->PhoneQuery->FieldByName( "TeleCode")->AsString);
pDMTelSys->PhoneQuery->Next();
}
}
//---------------------------------------------------------------------------
void __fastcall TDlgStatSelfTel::FormClose(TObject *Sender,
TCloseAction &Action)
{
Action = caFree;
DlgStatSelfTel = NULL;
}
//---------------------------------------------------------------------------
void __fastcall TDlgStatSelfTel::OKBtnClick(TObject *Sender)
{
bool bOccer = false;
SQLStr = "select A.*, B.area, B.location from GS_Bill A left join TelType B ";
SQLStr += " on A.local_code = B.local_code and A.type = B.type ";
SQLStr += " where startdate >= :BeginDate"; //+ DPBeginDate->Date.DateString();
SQLStr += " and startdate <= :EndDate"; // + DPEndDate->Date.DateString();
SQLStr += " and phone = '" + CBPhone->Text;
SQLStr += "' and charge > 0 ";
if( ChkType34->Checked) {
bOccer = true;
SQLStr += " and ( A.type = 3 " ;
}
if( ChkType25->Checked) {
if( bOccer)
SQLStr += " or A.type = 2";
else{
SQLStr += " and ( A.type = 2";
bOccer = true;
}
}
if( ChkType1->Checked) {
if( bOccer)
SQLStr += " or A.type = 1";
else {
bOccer = true;
SQLStr += " and ( A.type = 1";
}
}
if( ChkType0->Checked) {
if( bOccer)
SQLStr += " or A.type = 0";
else {
bOccer = true;
SQLStr += " and ( A.type = 0";
}
}
if( CHBMobile->Checked) {
if( bOccer) {
SQLStr += " or A.type = 5 ";
}
else {
bOccer = true;
SQLStr += " and ( A.type = 5 ";
}
}
if( bOccer)
SQLStr += ")";
EndDate = DPEndDate->Date;
BeginDate = DPBeginDate->Date;
//Phone = CBPhone->Text;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -