apand.cpp

来自「一个以前收集的基于C/S架构的ERP客户端源代码」· C++ 代码 · 共 61 行

CPP
61
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "ApAnd.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "StdBaseForm"
#pragma link "SDGrid"
#pragma resource "*.dfm"
TfrmApAnd *frmApAnd;
//---------------------------------------------------------------------------
__fastcall TfrmApAnd::TfrmApAnd(TComponent* Owner)
        : TStdBaseForm(Owner)
{
  m_FilterStr="";
}
//---------------------------------------------------------------------------
void __fastcall TfrmApAnd::FillGridWithData()
{

   TComResultSet *RsQuery=new  TComResultSet(Handle,g_ClientHandle);
   AnsiString  ItemStr="",m_FiStr="";
   if(m_FilterStr=="")
       m_FiStr="";
   else
       m_FiStr=" where "+m_FilterStr;
   m_SQL=" select * from sdVW_ApAnGetRecord "+m_FiStr+" order by DocCode";
   sgApAnd->RowCount=1;
   try
   {
     RsQuery->Open(m_SQL,"");
     RsQuery->MoveFirst();
     while( RsQuery->Eof == 0)
     {
      ItemStr= "\t" +RsQuery->FieldByName("DocCode")    +
               "\t" +RsQuery->FieldByName("DocDate")    +
               "\t" +RsQuery->FieldByName("DocPDate")    +
               "\t" +RsQuery->FieldByName("DocCurrency")    +
               "\t" +RsQuery->FieldByName("DocEnrate")    +
               "\t" +RsQuery->FieldByName("DocAmt")    ;
      sgApAnd->AddItem(ItemStr);
      RsQuery->MoveNext();
    }
   }             
   __finally
   {
     delete  RsQuery;
   }  
}
//---------------------------------------------------------------------------
void __fastcall TfrmApAnd::FormShow(TObject *Sender)
{
    m_FilterStr=" DocSupply ='"+  m_Supply+"' and DocAmt>0" ;//查询条件字串
    m_SQL="";      //查询语句
    FillGridWithData();

}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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