qu_apob.cpp
来自「一个以前收集的基于C/S架构的ERP客户端源代码」· C++ 代码 · 共 142 行
CPP
142 行
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Qu_Apob.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "QueryBaseForm"
#pragma link "SDGrid"
#pragma link "KSAdvReport"
#pragma resource "*.dfm"
TfrmQu_Apob *frmQu_Apob;
//---------------------------------------------------------------------------
__fastcall TfrmQu_Apob::TfrmQu_Apob(TComponent* Owner, HWND chWnd, AnsiString MidCode,AnsiString WhereStr)
: TQueryBaseForm(Owner,chWnd,MidCode,WhereStr)
{
m_SQL=""; //查询语句
QueryGrid=sgApob;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::ClearControl(bool BringToNext)
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::GetDataFromComObject()
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::WaitUserInput()
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::RefreshGridData(int mAction)
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::DisplayBill()
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::GetBill(AnsiString BillID)
{
return;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::FillGridWithData()
{
TComResultSet *RsQuery=new TComResultSet(Handle,g_ClientHandle);
AnsiString ItemStr="",m_FiStr="";
if(FilterStr=="")
m_FiStr="";
else
m_FiStr=" where "+FilterStr;
m_SQL=" select * from sdVW_Apob "+m_FiStr+" order by ApobCode";
sgApob->RowCount=1;
try
{
RsQuery->Open(m_SQL,"");
RsQuery->MoveFirst();
while( RsQuery->Eof == 0)
{
ItemStr= "\t" +RsQuery->FieldByName("ApobFmonth") +
"\t" +RsQuery->FieldByName("ApobCode") +
"\t" +RsQuery->FieldByName("ApobDate") +
"\t" +RsQuery->FieldByName("ApobPDate") +
"\t" +RsQuery->FieldByName("SupplyName") +
"\t" +RsQuery->FieldByName("ApobCurrency") +
"\t" +RsQuery->FieldByName("ApobEnrate") +
"\t" +RsQuery->FieldByName("ApobAmt") +
"\t" +RsQuery->FieldByName("ApobCAmt") +
"\t" +RsQuery->FieldByName("ApobRAmt") +
"\t" +(RsQuery->FieldByName("ApobRed")==-1?"红字":"兰字")+
"\t" +RsQuery->FieldByName("ApobOCode") +
"\t" +RsQuery->FieldByName("ApobUser") +
"\t" +(RsQuery->FieldByName("ApobCheck")==1?"审核":"未审核") +
"\t" +RsQuery->FieldByName("ApobChecker") +
"\t" +RsQuery->FieldByName("ApobCheckDate") +
"\t" +RsQuery->FieldByName("ApobSysDate") +
"\t" +RsQuery->FieldByName("ApobDesc") ;
sgApob->AddItem(ItemStr);
RsQuery->MoveNext();
}
RsQuery->Close();
}
__finally
{
delete RsQuery;
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::tbQueryClick(TObject *Sender)
{
// if(!ShowQueryWindow())
// return;
try{
StartWaitForm("正在查询,请稍候...");
FillGridWithData();
}
__finally
{
EndWaitForm();
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::tbRefreshClick(TObject *Sender)
{
if(m_SQL!="")
FillGridWithData();
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::muFirstClick(TObject *Sender)
{
if(sgApob->RowCount > 1)
sgApob->Row=1;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::muPreviousClick(TObject *Sender)
{
if( sgApob->Row>1)
sgApob->Row--;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::muNextClick(TObject *Sender)
{
if( sgApob->Row < sgApob->RowCount-1)
sgApob->Row++;
}
//---------------------------------------------------------------------------
void __fastcall TfrmQu_Apob::muLastClick(TObject *Sender)
{
if(sgApob->RowCount > 1)
sgApob->Row=sgApob->RowCount-1;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?