📄 qu_fadc.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Qu_FaDc.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "QueryBaseForm"
#pragma link "SDGrid"
#pragma resource "*.dfm"
TfrmQu_FaDc *frmQu_FaDc;
//---------------------------------------------------------------------------
__fastcall TfrmQu_FaDc::TfrmQu_FaDc(TComponent* Owner)
: TQueryBaseForm(Owner)
{
m_FilterStr=""; //查询条件字串
m_SQL=""; //查询语句
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::ClearControl(bool BringToNext)
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::GetDataFromComObject()
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::WaitUserInput()
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::RefreshGridData(int mAction)
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::DisplayBill()
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::GetBill(AnsiString BillID)
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::FillGridWithData()
{
TComResultSet *RsQuery=NewResultSet();
AnsiString ItemStr="";
if(m_FilterStr=="")
m_FilterStr="";
else
m_FilterStr=" where "+m_FilterStr;
m_SQL=" select * from sdVW_FaDc "+m_FilterStr+" order by FaDcFadn";
sgFaDc->RowCount=1;
try
{
RsQuery->Open(m_SQL,"");
RsQuery->MoveFirst();
while( RsQuery->Eof == 0)
{
ItemStr="\t"+RsQuery->FieldByName("FaDcFadn")+
"\t"+RsQuery->FieldByName("FADNNAME")+
"\t"+RsQuery->FieldByName("FaDcFMonth")+
"\t"+RsQuery->FieldByName("FadmName")+
"\t"+RsQuery->FieldByName("FaDcOVal")+
"\t"+RsQuery->FieldByName("FaDcVal")+
"\t"+RsQuery->FieldByName("FaDcDVal")+
"\t"+RsQuery->FieldByName("FaDcEVal")+
"\t"+RsQuery->FieldByName("FaDcTWork")+
"\t"+RsQuery->FieldByName("FaDcAWork")+
"\t"+RsQuery->FieldByName("FaDcPeriod")+
"\t"+RsQuery->FieldByName("FaDcAPeriod")+
"\t"+RsQuery->FieldByName("FaDcUser")+
"\t"+(RsQuery->FieldByName("FaDcPost")=="1"? "是":"否")+
"\t"+RsQuery->FieldByName("FaDcPzCode");
sgFaDc->AddItem(ItemStr);
RsQuery->MoveNext();
}
RsQuery->Close();
}
__finally
{
delete RsQuery;
}
}
//---------------------------------------------------------------------------
bool __fastcall TfrmQu_FaDc::ShowQueryWindow()
{
TfrmQuForm *FQuery=new TfrmQuForm(this,this->Name);
FQuery->ShowModal();
if(FQuery->CancelQuery)
return false;
m_FilterStr=FQuery->CreateSqlString;
delete FQuery;
return true;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::tbQueryClick(TObject *Sender)
{
if(!ShowQueryWindow())
return;
try{
StartWaitForm("正在查询,请稍候...");
FillGridWithData();
}
__finally
{
EndWaitForm();
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::tbRefreshClick(TObject *Sender)
{
if(m_SQL=="")
FillGridWithData();
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::muFirstClick(TObject *Sender)
{
if(sgFaDc->RowCount > 1)
sgFaDc->Row=1;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::muPreviousClick(TObject *Sender)
{
if( sgFaDc->Row>1)
sgFaDc->Row--;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::muNextClick(TObject *Sender)
{
if( sgFaDc->Row < sgFaDc->RowCount-1)
sgFaDc->Row++;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_FaDc::muLastClick(TObject *Sender)
{
if(sgFaDc->RowCount > 1)
sgFaDc->Row=sgFaDc->RowCount-1;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -