sexcdview.cpp

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

CPP
155
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "SexcdView.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "DateEdit"
#pragma link "fpanel"
#pragma link "ListBaseForm"
#pragma link "SDComboBox"
#pragma link "SDEdit"
#pragma link "SDGrid"
#pragma resource "*.dfm"
TfrmSexcdView *frmSexcdView;
//---------------------------------------------------------------------------
__fastcall TfrmSexcdView::TfrmSexcdView(TComponent* Owner, HWND chWnd, AnsiString MidCode,AnsiString WhereStr)
        : TListBaseForm(Owner,chWnd,MidCode,WhereStr)
{
 BillNumID=WhereStr;
}

__fastcall TfrmSexcdView::TfrmSexcdView(TComponent* Owner)
        : TListBaseForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::InitEditControl()
{
 FillComboBox(Handle,scSexchCurrency,"select CurrencyCode,CurrencyName from sdCurrency","CurrencyName","CurrencyCode");
 FillComboBox(Handle,scSexchClient,"select ClientCode,ClientName from sdClient order by ClientCode","ClientName","ClientCode");

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

void __fastcall TfrmSexcdView::ClearControl()
{
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::GetDataFromComObject(int Section)
{
        if (Section==1)
        {
        seSexchCode->Text       =GetHeadValue("SexchCode");
        scSexchClient->LocateKey(GetHeadValue("SexchClient"));
        scSexchCurrency->LocateKey(GetHeadValue("SexchCurrency"));
        }
        else
        {
        }
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::SendDataToComObject(int Section)
{
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::WaitUserInput(int Section)
{
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::RefreshGridData(int mAction)
{
             AnsiString ItemStr;

              ItemStr="\t"+GetDetailValue("SexcdLine")+"\t"+GetDetailValue("SexcdSretCode")+"\t"+
				  GetDetailValue("SexcdGoodsName")+"\t"+GetDetailValue("SexcdGoodsSpec")+"\t"+
          		  GetDetailValue("SexcdGoodsName")+"\t"+GetDetailValue("SexcdGoodsSpec")+"\t"+
                  GetDetailValue("SexcdSretdLine")+"\t"+GetDetailValue("SexcdGoods")+"\t"+
                  GetDetailValue("SexcdUnit")+"\t"+GetDetailValue("SexcdQty")+"\t"+
                  GetDetailValue("SexcdExes");

              sgSexcd->AddItem(ItemStr);
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::DisplayBill()
{
        GetDataFromComObject(1);
        FillGridWithData();
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::GetBill(AnsiString BillID)
{
    comServer->FilterString=WideString("SexchCode='"+BillID+"'");
    comServer->Query();
    if (comServer->RecordCount!=0)      //Found it
       {
         DisplayBill();
       }
       else
        ShowMessageWindow("在数据库中没有查到记录:"+BillID+",请查证",mwsInformation);
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::FillGridWithData()
{
      int i;
      sgSexcd->RowCount=1;
      for (i=0;i<comServer->ItemCount;i++)
      {
          comServer->LocateItemByIndex(i);
          RefreshGridData(0);
      }
}
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------

//---------------------------------------------------------------------------

//---------------------------------------------------------------------------

//---------------------------------------------------------------------------



void __fastcall TfrmSexcdView::FormShow(TObject *Sender)
{
       ClearControl();
       GetBill(BillNumID);
       ChangeToBrowseState(true);

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



void __fastcall TfrmSexcdView::ChangeToBrowseState(bool Browse)
{

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

void __fastcall TfrmSexcdView::btnOKClick(TObject *Sender)
{
      ChangeToBrowseState(true);
}
//---------------------------------------------------------------------------

void __fastcall TfrmSexcdView::FormClose(TObject *Sender,
	  TCloseAction &Action)
{
		TListBaseForm::FormClose(Sender, Action);

//...
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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