Ignore:
Timestamp:
Jun 13, 2011, 8:25:31 AM (13 years ago)
Author:
george
Message:
  • Modified: USqlDatabase used from CoolWeb package.
  • Added: Store item data to database for Add and Edit dialog.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        44heaptrclog.trc
        55chronis.exe
         6DebugLog.txt
  • trunk/Application/UDataTypes.pas

    r14 r15  
    1616    function CreateControl(Owner: TComponent): TWinControl; virtual;
    1717    procedure SetupControl(Control: TWinControl); virtual;
     18    function GetControlValue(Control: TWinControl): string; virtual;
    1819    procedure Load(CellValue: string); virtual;
    1920    procedure LoadDef(CustomType: Integer); virtual;
     
    3031    function CreateControl(Owner: TComponent): TWinControl; override;
    3132    procedure SetupControl(Control: TWinControl); override;
     33    function GetControlValue(Control: TWinControl): string; override;
    3234    procedure Load(CellValue: string); override;
    3335    procedure LoadDef(CustomType: Integer); override;
     
    4244    function CreateControl(Owner: TComponent): TWinControl; override;
    4345    procedure SetupControl(Control: TWinControl); override;
     46    function GetControlValue(Control: TWinControl): string; override;
    4447    procedure Load(CellValue: string); override;
    4548  end;
     
    6265    Default: Boolean;
    6366    function CreateControl(Owner: TComponent): TWinControl; override;
     67    function GetControlValue(Control: TWinControl): string; override;
    6468    procedure SetupControl(Control: TWinControl); override;
    6569    procedure Load(CellValue: string); override;
     
    8387    Max: TDateTime;
    8488    function CreateControl(Owner: TComponent): TWinControl; override;
     89    function GetControlValue(Control: TWinControl): string; override;
    8590    procedure SetupControl(Control: TWinControl); override;
    8691    procedure Load(CellValue: string); override;
     
    95100    Max: Double;
    96101    function CreateControl(Owner: TComponent): TWinControl; override;
     102    function GetControlValue(Control: TWinControl): string; override;
    97103    procedure SetupControl(Control: TWinControl); override;
    98104    procedure Load(CellValue: string); override;
     
    185191end;
    186192
     193function TDataTypeFloat.GetControlValue(Control: TWinControl): string;
     194begin
     195  Result := MySQLFloatToStr(TFloatSpinEdit(Control).Value);
     196end;
     197
    187198procedure TDataTypeFloat.SetupControl(Control: TWinControl);
    188199begin
     
    202213end;
    203214
     215function TDataTypeDate.GetControlValue(Control: TWinControl): string;
     216begin
     217  Result := DateTimeToSQL(TDateEdit(Control).Date);
     218end;
     219
    204220procedure TDataTypeDate.SetupControl(Control: TWinControl);
    205221begin
     
    217233begin
    218234  Result := TCheckBox.Create(Owner);
     235end;
     236
     237function TDataTypeBoolean.GetControlValue(Control: TWinControl): string;
     238begin
     239  Result := IntToStr(Integer(TCheckBox(Control).Checked));
    219240end;
    220241
     
    242263end;
    243264
     265function TDataTypeNumber.GetControlValue(Control: TWinControl): string;
     266begin
     267  Result := IntToStr(TSpinEdit(Control).Value);
     268end;
     269
    244270procedure TDataTypeNumber.Load(CellValue: string);
    245271begin
     
    265291end;
    266292
     293function TDataTypeString.GetControlValue(Control: TWinControl): string;
     294begin
     295  Result := TEdit(Control).Text;
     296end;
     297
    267298procedure TDataTypeString.Load(CellValue: string);
    268299begin
     
    282313end;
    283314
     315function TDataType.GetControlValue(Control: TWinControl): string;
     316begin
     317
     318end;
     319
    284320procedure TDataType.Load(CellValue: string);
    285321begin
Note: See TracChangeset for help on using the changeset viewer.