Ignore:
Timestamp:
Jun 14, 2011, 12:20:15 PM (13 years ago)
Author:
george
Message:
  • Added: Import existed database structure form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.pas

    r17 r19  
    1515
    1616  TMainForm = class(TForm)
     17  published
    1718    AConnect: TAction;
     19    AImportStructure: TAction;
    1820    AInitSystemValues: TAction;
    1921    ASettings: TAction;
     
    5052    MenuItem19: TMenuItem;
    5153    MenuItem2: TMenuItem;
     54    MenuItem20: TMenuItem;
    5255    MenuItem3: TMenuItem;
    5356    MenuItem4: TMenuItem;
     
    6669    procedure AConnectExecute(Sender: TObject);
    6770    procedure AExitExecute(Sender: TObject);
     71    procedure AImportStructureExecute(Sender: TObject);
    6872    procedure AInitSystemValuesExecute(Sender: TObject);
    6973    procedure AItemAddExecute(Sender: TObject);
     
    124128uses
    125129  UItemView, UItemEdit, UItemAdd, ULoginForm, USettingForm, UApplicationInfo,
    126   UCore;
     130  UCore, UImportStructureForm;
    127131
    128132{$R *.lfm}
     
    340344        '`Min` int NOT NULL,' +
    341345        '`Max` int NOT NULL,' +
     346        'KEY `CustomType` (`CustomType`),' +
     347        'PRIMARY KEY (`Id`)' +
     348        ') ENGINE=InnoDB  DEFAULT CHARSET=utf8');
     349    end;
     350
     351    if Tables.IndexOf(TypeFloat) = -1 then begin
     352      Database.Query(DbRows, 'CREATE TABLE IF NOT EXISTS `' + TypeFloat + '` ( ' +
     353        '`Id` int(11) NOT NULL AUTO_INCREMENT,' +
     354        '`CustomType` int NOT NULL,' +
     355        '`Default` float NOT NULL,' +
     356        '`Min` float NOT NULL,' +
     357        '`Max` float NOT NULL,' +
    342358        'KEY `CustomType` (`CustomType`),' +
    343359        'PRIMARY KEY (`Id`)' +
     
    555571begin
    556572  Close;
     573end;
     574
     575procedure TMainForm.AImportStructureExecute(Sender: TObject);
     576begin
     577  ImportStructureForm.ShowModal;
    557578end;
    558579
Note: See TracChangeset for help on using the changeset viewer.