home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue68 / Construc / Unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2001-02-28  |  1.5 KB  |  62 lines

  1. unit Unit1;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   ExtCtrls, DBCtrls, StdCtrls, Mask, Grids, Calendar, DMCalendar, Db,
  6.   DBTables;
  7.  
  8. type
  9.   TForm1 = class(TForm)
  10.     Table1: TTable;
  11.     DataSource1: TDataSource;
  12.     Table1OrderNo: TFloatField;
  13.     Table1CustNo: TFloatField;
  14.     Table1SaleDate: TDateTimeField;
  15.     Table1ShipDate: TDateTimeField;
  16.     Table1EmpNo: TIntegerField;
  17.     Table1ShipToContact: TStringField;
  18.     Table1ShipToAddr1: TStringField;
  19.     Table1ShipToAddr2: TStringField;
  20.     Table1ShipToCity: TStringField;
  21.     Table1ShipToState: TStringField;
  22.     Table1ShipToZip: TStringField;
  23.     Table1ShipToCountry: TStringField;
  24.     Table1ShipToPhone: TStringField;
  25.     Table1ShipVIA: TStringField;
  26.     Table1PO: TStringField;
  27.     Table1Terms: TStringField;
  28.     Table1PaymentMethod: TStringField;
  29.     Table1ItemsTotal: TCurrencyField;
  30.     Table1TaxRate: TFloatField;
  31.     Table1Freight: TCurrencyField;
  32.     Table1AmountPaid: TCurrencyField;
  33.     DMCalendar1: TDMCalendar;
  34.     DBEdit1: TDBEdit;
  35.     DBNavigator1: TDBNavigator;
  36.     Button1: TButton;
  37.     procedure Button1Click(Sender: TObject);
  38.   private
  39.     { Private declarations }
  40.   public
  41.     { Public declarations }
  42.   end;
  43.  
  44. var
  45.   Form1: TForm1;
  46.  
  47. implementation
  48.  
  49. {$R *.DFM}
  50.  
  51. procedure TForm1.Button1Click(Sender: TObject);
  52. var
  53.   DW: IDataAware;
  54. begin
  55.   if DMCalendar1.GetInterface(IDataAware, DW) then
  56.     ShowMessage(DW.DataSource.DataSet.ClassName)
  57.   else
  58.     ShowMessage('no hello');
  59. end;
  60.  
  61. end.
  62.