⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sexcdview.cpp

📁 速达开源ERP系统
💻 CPP
字号:
//---------------------------------------------------------------------------

#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)
        : TListBaseForm(Owner,euSdSexch,"")
{

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

void __fastcall TfrmSexcdView::InitEditControl()
{
 FillComboBox(scSexchCurrency,"select CurrencyCode,CurrencyName from sdCurrency","CurrencyName","CurrencyCode");
 FillComboBox(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(fiSexchCode);
        scSexchClient->LocateKey(GetHeadValue(fiSexchClient));
        scSexchCurrency->LocateKey(GetHeadValue(fiSexchCurrency));
        }
        else
        {
        }
}
//---------------------------------------------------------------------------

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

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

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

              ItemStr="\t"+GetDetailValue(fiSexcdLine)+"\t"+GetDetailValue(fiSexcdSretCode)+"\t"+
                  GetDetailValue(fiSexcdSretdLine)+"\t"+GetDetailValue(fiSexcdGoods)+"\t"+
                  GetDetailValue(fiSexcdUnit)+"\t"+GetDetailValue(fiSexcdQty)+"\t"+
                  GetDetailValue(fiSexcdExes);

              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);
      }
}
//---------------------------------------------------------------------------

AnsiString __fastcall TfrmSexcdView::GetHeadValue(int Index)
{
        WideString S;
        S = ReadFieldValue(comServer,Index);
        return S;
}
//---------------------------------------------------------------------------

AnsiString __fastcall TfrmSexcdView::GetDetailValue(int Index)
{
        WideString S;
        S = ReadItemValue(comServer,Index);
        return S;
}
//---------------------------------------------------------------------------
void __fastcall TfrmSexcdView::SetHeadValue(int Index,AnsiString Value)
{
       WriteFieldValue(comServer,Index,WideString(Value));
}

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

void __fastcall TfrmSexcdView::SetDetailValue(int Index,AnsiString Value)
{
       WriteItemValue(comServer,Index,WideString(Value));
}
//---------------------------------------------------------------------------



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)
{
//...
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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