GoodManage.cpp
上传用户:tangpei45
上传日期:2013-07-14
资源大小:9104k
文件大小:2k
源码类别:

百货/超市行业

开发平台:

C++ Builder

  1. //----------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "GoodManage.h"
  5. //----------------------------------------------------------------------------
  6. #pragma resource "*.dfm"
  7. TfmGoodManage *fmGoodManage;
  8. //----------------------------------------------------------------------------
  9. __fastcall TfmGoodManage::TfmGoodManage(TComponent *Owner)
  10. : TForm(Owner)
  11. {
  12. }
  13. //----------------------------------------------------------------------------
  14. void __fastcall TfmGoodManage::FormCreate(TObject *Sender)
  15. {
  16. Table1->Open();
  17. }
  18. //----------------------------------------------------------------------------
  19. void __fastcall TfmGoodManage::FormClose(TObject *Sender,
  20.       TCloseAction &Action)
  21. {
  22.   // 删除窗体并回收空间
  23.     Action = caFree;
  24. }
  25. //---------------------------------------------------------------------------
  26. void __fastcall TfmGoodManage::Button1Click(TObject *Sender)
  27. {
  28.     Table1->Filtered = false;
  29.     // 设置table控件的filter属性
  30.     // 可以起到查询条件的作用
  31.     if(Edit1->Text.Length()==0)
  32.         Table1->Filter = "";
  33.     else
  34.         Table1->Filter = " 拼音编码 = '" + Edit1->Text + "*'";
  35.     Table1->Filtered = true;
  36. }
  37. //---------------------------------------------------------------------------
  38. void __fastcall TfmGoodManage::DBGrid1DblClick(TObject *Sender)
  39. {
  40.     if(m_Input)
  41.     {
  42.         m_szSelectCode = Table1->FieldByName("货号")->AsString;
  43.         this->Close();
  44.     }    
  45. }
  46. //---------------------------------------------------------------------------