- Timestamp:
- Mar 9, 2012, 8:11:13 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Clients/UChronisClientMySQL.pas
r38 r40 88 88 NewObject := TObjectProxy.Create; 89 89 NewObject.Client := AList.Client; 90 NewObject.ObjectName := AList.ObjectName; 91 NewObject.SchemaName := AList.SchemaName; 90 92 NewObject.Properties.Assign(TDictionaryStringString(DbRows[I])); 91 93 AList.Objects.Add(NewObject); -
trunk/Application/UDataTypes.pas
r37 r40 14 14 15 15 TDataType = class 16 Name: string; 16 17 CustomType: Integer; 17 18 Control: TWinControl; … … 23 24 procedure SetDefault; virtual; 24 25 function GetStringValue: string; virtual; 26 constructor Create; virtual; 25 27 end; 26 28 … … 37 39 procedure Load(CellValue: string); override; 38 40 procedure LoadDef(CustomType: Integer); override; 41 constructor Create; override; 39 42 end; 40 43 … … 49 52 function GetControlValue(Control: TWinControl): string; override; 50 53 procedure Load(CellValue: string); override; 54 constructor Create; override; 51 55 end; 52 56 … … 60 64 procedure SetupControl(Control: TWinControl); override; 61 65 procedure Load(CellValue: string); override; 66 constructor Create; override; 62 67 end; 63 68 … … 71 76 procedure SetupControl(Control: TWinControl); override; 72 77 procedure Load(CellValue: string); override; 78 constructor Create; override; 73 79 end; 74 80 … … 86 92 procedure Load(CellValue: string); override; 87 93 procedure LoadDef(ACustomType: Integer); override; 94 constructor Create; override; 88 95 end; 89 96 … … 99 106 procedure Load(CellValue: string); override; 100 107 procedure LoadDef(ACustomType: Integer); override; 108 constructor Create; override; 101 109 end; 102 110 … … 112 120 procedure SetupControl(Control: TWinControl); override; 113 121 procedure Load(CellValue: string); override; 122 constructor Create; override; 114 123 end; 115 124 … … 123 132 procedure SetupControl(Control: TWinControl); override; 124 133 procedure Load(CellValue: string); override; 134 constructor Create; override; 125 135 end; 126 136 … … 136 146 procedure SetupControl(Control: TWinControl); override; 137 147 procedure Load(CellValue: string); override; 148 constructor Create; override; 138 149 end; 139 150 … … 144 155 145 156 uses 146 USqlDatabase, USystem, UCore, UItemSelect ;157 USqlDatabase, USystem, UCore, UItemSelect, UMainForm; 147 158 148 159 function GetDataType(ACustomType: Integer): TDataType; … … 216 227 end; 217 228 229 constructor TDataTypeDateTime.Create; 230 begin 231 inherited Create; 232 Name := 'DateType'; 233 end; 234 218 235 { TDataTypeRelationMany } 219 236 220 237 function TDataTypeRelationMany.CreateControl(Owner: TComponent): TWinControl; 221 238 begin 222 Result :=inherited CreateControl(Owner);239 Result := inherited CreateControl(Owner); 223 240 end; 224 241 … … 260 277 end; 261 278 279 constructor TDataTypeRelationMany.Create; 280 begin 281 inherited Create; 282 Name := 'RelationMany'; 283 end; 284 262 285 { TDataTypeRelationOne } 263 286 264 287 procedure TDataTypeRelationOne.ButtonClickExecute(Sender: TObject); 265 begin 266 ItemSelectForm.ObjectId := ObjectId; 267 ItemSelectForm.ShowModal; 268 TEditButton(Control).Text := IntToStr(ItemSelectForm.SelectedId) 288 var 289 NewSelectForm: TItemSelectForm; 290 begin 291 try 292 NewSelectForm := TItemSelectForm.Create(MainForm); 293 NewSelectForm.ObjectId := ObjectId; 294 NewSelectForm.ShowModal; 295 TEditButton(Control).Text := IntToStr(NewSelectForm.SelectedId) 296 finally 297 ItemSelectForm.Free; 298 end; 269 299 end; 270 300 … … 309 339 end; 310 340 341 constructor TDataTypeRelationOne.Create; 342 begin 343 inherited Create; 344 Name := 'RelationOne'; 345 end; 346 311 347 312 348 { TDataTypePassword } … … 327 363 end; 328 364 365 constructor TDataTypePassword.Create; 366 begin 367 inherited Create; 368 Name := 'Password'; 369 end; 370 329 371 { TDataTypeFloat } 330 372 … … 349 391 end; 350 392 393 constructor TDataTypeFloat.Create; 394 begin 395 inherited Create; 396 Name := 'Float'; 397 end; 398 351 399 { TDataTypeDateTime } 352 400 … … 371 419 end; 372 420 421 constructor TDataTypeDate.Create; 422 begin 423 inherited Create; 424 Name := 'Date'; 425 end; 426 373 427 { TDataTypeBoolean } 374 428 … … 391 445 begin 392 446 Value := Boolean(StrToInt(CellValue)); 447 end; 448 449 constructor TDataTypeBoolean.Create; 450 begin 451 inherited Create; 452 Name := 'Boolean'; 393 453 end; 394 454 … … 422 482 end; 423 483 484 constructor TDataTypeNumber.Create; 485 begin 486 inherited Create; 487 Name := 'Number'; 488 end; 489 424 490 { TDataTypeString } 425 491 … … 444 510 end; 445 511 512 constructor TDataTypeString.Create; 513 begin 514 inherited Create; 515 Name := 'String'; 516 end; 517 446 518 { TDataType } 447 519 … … 481 553 end; 482 554 555 constructor TDataType.Create; 556 begin 557 inherited; 558 end; 559 483 560 end. 484 561 -
trunk/Forms/UItemAdd.pas
r37 r40 124 124 Panel1.Controls[I].Free; 125 125 126 Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' +127 IntToStr(SelectedItemId));126 //Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' + 127 // IntToStr(SelectedItemId)); 128 128 129 129 // Load column names -
trunk/Forms/UItemList.pas
r39 r40 117 117 NewItemEditForm: TItemEditForm; 118 118 begin 119 if Assigned(ListView1.Selected) then begin 119 if Assigned(ListView1.Selected) then 120 try 120 121 NewItemEditForm := TItemEditForm.Create(nil); 121 122 NewItemEditForm.SelectedObject.Assign(SelectedObject); 122 123 NewItemEditForm.SelectedItemId := Integer(ListView1.Selected.Data); 123 124 NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name; 124 MainForm.SetMainPanelForm(NewItemEditForm); 125 NewItemEditForm.ShowModal; 126 finally 127 NewItemEditForm.Free; 125 128 end; 126 129 end; … … 130 133 NewItemAddForm: TItemAddForm; 131 134 begin 132 NewItemAddForm := TItemAddForm.Create(nil); 133 NewItemAddForm.SelectedObject.Assign(SelectedObject); 134 NewItemAddForm.SelectedItemId := Integer(ListView1.Selected.Data); 135 NewItemAddForm.Caption := NewItemAddForm.Caption + ' ' + SelectedObject.Name; 136 MainForm.SetMainPanelForm(NewItemAddForm); 135 try 136 NewItemAddForm := TItemAddForm.Create(nil); 137 NewItemAddForm.SelectedObject.Assign(SelectedObject); 138 //NewItemAddForm.SelectedItemId := Integer(ListView1.Selected.Data); 139 NewItemAddForm.Caption := NewItemAddForm.Caption + ' ' + SelectedObject.Name; 140 NewItemAddForm.ShowModal; 141 finally 142 NewItemAddForm.Free; 143 end; 137 144 end; 138 145 -
trunk/Forms/UItemView.pas
r36 r40 56 56 {$R *.lfm} 57 57 58 resourcestring 59 SExpectedOneRow = 'Expected one row'; 60 58 61 { TItemViewForm } 59 62 … … 106 109 NewItemEditForm: TItemEditForm; 107 110 begin 108 Close; 109 NewItemEditForm := TItemEditForm.Create(nil); 110 NewItemEditForm.SelectedObject.Assign(SelectedObject); 111 NewItemEditForm.SelectedItemId := SelectedItemId; 112 NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name; 113 MainForm.SetMainPanelForm(NewItemEditForm); 111 try 112 NewItemEditForm := TItemEditForm.Create(nil); 113 NewItemEditForm.SelectedObject.Assign(SelectedObject); 114 NewItemEditForm.SelectedItemId := SelectedItemId; 115 NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name; 116 NewItemEditForm.ShowModal; 117 finally 118 NewItemEditForm.Free; 119 end; 114 120 end; 115 121 … … 156 162 // Load column names 157 163 158 if Report.Count = 1 then 164 if Report.Count > 1 then raise Exception.Create(SExpectedOneRow); 165 if Report.Count > 0 then 159 166 for I := 0 to Report.Columns.Count - 1 do begin 160 167 DataType := TReportColumn(Report.Columns[I]).CustomType; -
trunk/Forms/ULoginForm.lfm
r30 r40 1 1 object LoginForm: TLoginForm 2 2 Left = 312 3 Height = 1 633 Height = 177 4 4 Top = 186 5 Width = 4 335 Width = 451 6 6 BorderIcons = [biSystemMenu] 7 7 BorderStyle = bsDialog 8 8 Caption = 'Login' 9 ClientHeight = 1 6310 ClientWidth = 4 339 ClientHeight = 177 10 ClientWidth = 451 11 11 OnClose = FormClose 12 12 OnShow = FormShow … … 31 31 Left = 112 32 32 Height = 25 33 Top = 1 2833 Top = 144 34 34 Width = 75 35 35 Caption = 'Close' 36 36 ModalResult = 11 37 37 OnClick = ButtonCancelClick 38 TabOrder = 538 TabOrder = 6 39 39 end 40 40 object ButtonLogin: TButton 41 41 Left = 16 42 42 Height = 25 43 Top = 1 2843 Top = 144 44 44 Width = 75 45 45 Caption = 'Login' … … 47 47 ModalResult = 1 48 48 OnClick = ButtonLoginClick 49 TabOrder = 449 TabOrder = 5 50 50 end 51 51 object EditUserName: TEdit … … 84 84 object Image1: TImage 85 85 Left = 272 86 Height = 1 4086 Height = 156 87 87 Top = 12 88 Width = 1 5288 Width = 168 89 89 end 90 90 object EditPassword: TEdit … … 97 97 TabOrder = 3 98 98 end 99 object CheckBoxRememberPassword: TCheckBox 100 Left = 16 101 Height = 17 102 Top = 121 103 Width = 120 104 Caption = 'Remember password' 105 TabOrder = 4 106 end 99 107 end -
trunk/Forms/ULoginForm.lrt
r27 r40 6 6 TLOGINFORM.LABEL3.CAPTION=Connection: 7 7 TLOGINFORM.BUTTONCHANGE.CAPTION=Change 8 TLOGINFORM.CHECKBOXREMEMBERPASSWORD.CAPTION=Remember password -
trunk/Forms/ULoginForm.pas
r30 r40 17 17 ButtonCancel: TButton; 18 18 ButtonLogin: TButton; 19 CheckBoxRememberPassword: TCheckBox; 19 20 ComboBoxConnection: TComboBox; 20 21 EditUserName: TEdit; … … 50 51 Core.LastProfile := ComboBoxConnection.ItemIndex; 51 52 Core.LastPassword := EditPassword.Text; 53 Core.RememberPassword := CheckBoxRememberPassword.Checked; 52 54 end; 53 55 54 56 procedure TLoginForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); 55 57 begin 56 MainForm.PersistentForm.Save(Self);58 //MainForm.PersistentForm.Save(Self); 57 59 end; 58 60 59 61 procedure TLoginForm.FormShow(Sender: TObject); 60 62 begin 61 MainForm.PersistentForm.Load(Self);63 //MainForm.PersistentForm.Load(Self); 62 64 EditUserName.Text := Core.LastUserName; 63 EditPassword.Text := '';65 EditPassword.Text := Core.LastPassword; 64 66 EditPassword.SetFocus; 67 CheckBoxRememberPassword.Checked := Core.RememberPassword; 65 68 Core.Profiles.FillStrings(ComboBoxConnection.Items); 66 69 ComboBoxConnection.ItemIndex := Core.LastProfile; -
trunk/Forms/UMainForm.lfm
r39 r40 1 1 object MainForm: TMainForm 2 Left = 3072 Left = 242 3 3 Height = 446 4 Top = 12 64 Top = 129 5 5 Width = 640 6 6 ActiveControl = PanelMenu -
trunk/Forms/UMainForm.pas
r39 r40 288 288 Core.System.Types.Clear; 289 289 FreeAndNil(Core.Client); 290 UpdateInterface; 290 291 end; 291 292 end; -
trunk/Languages/chronis.cs.po
r36 r40 176 176 msgstr "Přihásit" 177 177 178 #: tloginform.checkboxrememberpassword.caption 179 msgid "Remember password" 180 msgstr "" 181 178 182 #: tloginform.label1.caption 179 183 msgid "Username:" … … 398 402 msgstr "Verze" 399 403 404 #: uitemview.sexpectedonerow 405 msgid "Expected one row" 406 msgstr "" 407 400 408 #: uloginprofileform.sprofile 401 409 msgid "Profile" -
trunk/Languages/chronis.po
r36 r40 162 162 msgstr "" 163 163 164 #: tloginform.checkboxrememberpassword.caption 165 msgid "Remember password" 166 msgstr "" 167 164 168 #: tloginform.label1.caption 165 169 msgid "Username:" … … 376 380 msgstr "" 377 381 382 #: uitemview.sexpectedonerow 383 msgid "Expected one row" 384 msgstr "" 385 378 386 #: uloginprofileform.sprofile 379 387 msgid "Profile" -
trunk/UCore.pas
r38 r40 27 27 LastProfile: Integer; 28 28 LastPassword: string; 29 RememberPassword: Boolean; 29 30 Profiles: TProfileList; 30 31 RegistryKey: string; … … 84 85 LastProfile := ReadIntegerWithDefault('LastConnectProfile', -1); 85 86 LastUserName := ReadStringWithDefault('LastUserName', 'admin'); 87 LastPassword := ReadStringWithDefault('LastPassword', ''); 88 RememberPassword := ReadBoolWithDefault('RememberPassword', False); 86 89 finally 87 90 Free; … … 97 100 WriteInteger('LastConnectProfile', LastProfile); 98 101 WriteString('LastUserName', LastUserName); 102 if RememberPassword then WriteString('LastPassword', LastPassword) 103 else WriteString('LastPassword', ''); 104 WriteBool('RememberPassword', RememberPassword); 99 105 finally 100 106 Free; -
trunk/USystem.pas
r38 r40 233 233 Values.ObjectName := Obj.Table; 234 234 Values.SchemaName := Obj.Schema; 235 Values.Condition := Filter; 235 236 Values.Load; 236 237
Note:
See TracChangeset
for help on using the changeset viewer.