Changeset 39 for trunk/Forms/UFormContacts.pas
- Timestamp:
- Nov 29, 2021, 2:17:26 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContacts.pas
r36 r39 197 197 FormContact := TFormContact.Create(nil); 198 198 try 199 if FormContact.ShowModal = mrOK then begin200 199 Contact := TContact.Create; 201 Contact.Parent := Contacts.ContactsFile; 202 FormContact.SaveData(Contact); 203 Contacts.Add(Contact); 204 Core.DataFile.Modified := True; 205 ReloadList; 206 UpdateInterface; 207 end; 200 try 201 Contact.Parent := Contacts.ContactsFile; 202 FormContact.Contact := Contact; 203 if FormContact.ShowModal = mrOK then begin 204 Contacts.Add(Contact); 205 Contact := nil; 206 Core.DataFile.Modified := True; 207 ReloadList; 208 UpdateInterface; 209 end; 210 finally 211 if Assigned(Contact) then 212 Contact.Free; 213 end; 208 214 finally 209 215 FormContact.Free; … … 214 220 var 215 221 FormContact: TFormContact; 222 Contact: TContact; 216 223 begin 217 224 FormContact := TFormContact.Create(nil); 218 225 try 219 FormContact.LoadData(TContact(ListView1.Selected.Data)); 220 if FormContact.ShowModal = mrOK then begin 221 FormContact.SaveData(TContact(ListView1.Selected.Data)); 222 Core.DataFile.Modified := True; 223 ReloadList; 224 UpdateInterface; 226 Contact := TContact.Create; 227 Contact.Assign(TContact(ListView1.Selected.Data)); 228 FormContact.Contact := Contact; 229 try 230 if FormContact.ShowModal = mrOK then begin 231 TContact(ListView1.Selected.Data).Assign(Contact); 232 Core.DataFile.Modified := True; 233 ReloadList; 234 UpdateInterface; 235 end; 236 finally 237 Contact.Free; 225 238 end; 226 239 finally
Note:
See TracChangeset
for help on using the changeset viewer.