Changeset 20 for trunk/Application


Ignore:
Timestamp:
Jun 15, 2011, 11:11:59 AM (13 years ago)
Author:
george
Message:
  • Added: Import relation one and many from existed database.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UDataTypes.pas

    r17 r20  
    107107  end;
    108108
     109  TDataTypeDateTime = class(TDataType)
     110    Value: TDateTime;
     111    Default: TDateTime;
     112    Min: TDateTime;
     113    Max: TDateTime;
     114    function CreateControl(Owner: TComponent): TWinControl; override;
     115    function GetControlValue(Control: TWinControl): string; override;
     116    procedure SetupControl(Control: TWinControl); override;
     117    procedure Load(CellValue: string); override;
     118  end;
     119
    109120  { TDataTypeFloat }
    110121
     
    147158    Result := TDataTypeDate.Create;
    148159  end else
     160  if BaseType = Integer(vtDateTime) then begin
     161    Result := TDataTypeDateTime.Create;
     162  end else
    149163  if BaseType = Integer(vtFloat) then begin
    150164    Result := TDataTypeFloat.Create;
     
    168182  end;
    169183  Result.CustomType := ACustomType;
     184end;
     185
     186{ TDataTypeDateTime }
     187
     188function TDataTypeDateTime.CreateControl(Owner: TComponent): TWinControl;
     189begin
     190  Result := TDateEdit.Create(Owner);
     191end;
     192
     193function TDataTypeDateTime.GetControlValue(Control: TWinControl): string;
     194begin
     195  Result := DateTimeToSQL(TDateEdit(Control).Date);
     196end;
     197
     198procedure TDataTypeDateTime.SetupControl(Control: TWinControl);
     199begin
     200  TDateEdit(Control).Date := Value;
     201end;
     202
     203procedure TDataTypeDateTime.Load(CellValue: string);
     204begin
     205  Value := SQLToDateTime(CellValue);
    170206end;
    171207
Note: See TracChangeset for help on using the changeset viewer.