home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / EDCUST.CPP < prev    next >
C/C++ Source or Header  |  1997-02-28  |  1KB  |  38 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 "edcust.h"
  10. #include "Datamod.h"
  11. //---------------------------------------------------------------------------
  12. #pragma resource "*.dfm"
  13. TEdCustForm *EdCustForm;
  14. //---------------------------------------------------------------------------
  15. __fastcall TEdCustForm::TEdCustForm(TComponent* Owner)
  16.     : TForm(Owner)
  17. {
  18. }
  19. //---------------------------------------------------------------------------
  20. void __fastcall TEdCustForm::PrintBtnClick(TObject *Sender)
  21. {
  22.   if(MessageBox(Handle,"   Print this form?", "Confirmation",MB_YESNO)==IDYES)
  23.     Print();
  24. }
  25. //---------------------------------------------------------------------------
  26. void __fastcall TEdCustForm::FormCloseQuery(TObject *Sender, bool &CanClose)
  27. {
  28.   CanClose = MastData->DataSetApplyUpdates(MastData->Cust, ModalResult==mrOk);
  29. }
  30. //---------------------------------------------------------------------------
  31. void TEdCustForm::Edit(double CustNo)
  32. {
  33.   Set<TLocateOption,0,1>flags;
  34.   MastData->Cust->Open();
  35.   MastData->Cust->Locate("CustNo", CustNo, flags);
  36.   ShowModal();
  37. }
  38.