home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / EDPARTS.CPP < prev    next >
C/C++ Source or Header  |  1997-02-28  |  1KB  |  40 lines

  1. //---------------------------------------------------------------------------
  2. // Borland C++Builder
  3. // Copyright (c) 1987, 1997 Borland International Inc.  All Rights Reserved.
  4. //---------------------------------------------------------------------------
  5. //---------------------------------------------------------------------------
  6. #include <vcl\vcl.h>
  7. #pragma hdrstop
  8.  
  9. #include "edparts.h"
  10. #include "Datamod.h"
  11. //---------------------------------------------------------------------------
  12. #pragma resource "*.dfm"
  13. TEdPartsForm *EdPartsForm;
  14. //---------------------------------------------------------------------------
  15. __fastcall TEdPartsForm::TEdPartsForm(TComponent* Owner)
  16.     : TForm(Owner)
  17. {
  18. }
  19. //---------------------------------------------------------------------------
  20. void TEdPartsForm::Edit(Double PartNo)
  21. {
  22.   TLocateOptions flags;
  23.   MastData->Parts->Open();
  24.   MastData->Parts->Locate("PartNo", PartNo, flags);
  25.   ShowModal();
  26. }
  27.  
  28. void __fastcall TEdPartsForm::PrintBtnClick(TObject *Sender)
  29. {
  30.   if ( MessageBox(Handle,"  Print this form?","Confirmation",MB_YESNO) )
  31.      Print();
  32. }
  33. //---------------------------------------------------------------------------
  34.  
  35. void __fastcall TEdPartsForm::FormCloseQuery(TObject *Sender, bool &CanClose)
  36. {
  37.   CanClose = MastData->DataSetApplyUpdates(MastData->Parts, ModalResult==mrOk);
  38. }
  39. //---------------------------------------------------------------------------
  40.