Ignore:
Timestamp:
Dec 1, 2021, 11:41:48 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Correctly load/save general, home and work fields.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.pas

    r39 r40  
    1818    ButtonCancel: TButton;
    1919    ButtonOk: TButton;
    20     EditAddressHomeCity: TEdit;
    21     EditAddressHomeCountry: TEdit;
    22     EditAddressHomePostalCode: TEdit;
    23     EditAddressHomePostOfficeBox: TEdit;
    24     EditAddressHomeRegion: TEdit;
    25     EditAddressHomeStreetExtended: TEdit;
    26     EditAddressWorkStreet: TEdit;
     20    EditHomeAddressCity: TEdit;
     21    EditHomeAddressCountry: TEdit;
     22    EditHomeAddressPostalCode: TEdit;
     23    EditHomeAddressPostOfficeBox: TEdit;
     24    EditHomeAddressRegion: TEdit;
     25    EditHomeAddressStreet: TEdit;
     26    EditHomeAddressStreetExtended: TEdit;
    2727    EditAddressWorkCity: TEdit;
    28     EditAddressWorkRegion: TEdit;
    2928    EditAddressWorkCountry: TEdit;
    30     EditAddressHomeStreet: TEdit;
    31     EditWebWork: TEdit;
    3229    EditAddressWorkPostalCode: TEdit;
    3330    EditAddressWorkPostOfficeBox: TEdit;
     31    EditAddressWorkRegion: TEdit;
     32    EditAddressWorkStreet: TEdit;
    3433    EditAddressWorkStreetExtended: TEdit;
     34    EditAniversary: TEdit;
     35    EditWorkEmail: TEdit;
     36    EditPager: TEdit;
     37    EditFax: TEdit;
     38    EditWeb: TEdit;
     39    EditHomeFax: TEdit;
     40    EditWorkFax: TEdit;
     41    EditHomeMobile: TEdit;
     42    EditWorkMobile: TEdit;
     43    EditWorkPager: TEdit;
     44    EditHomePhone: TEdit;
     45    EditNickName: TEdit;
     46    EditHomePager: TEdit;
     47    EditHomeEmail: TEdit;
     48    EditHomeWeb: TEdit;
     49    EditWorkWeb: TEdit;
    3550    EditDepartment: TEdit;
    3651    EditFullName: TEdit;
     
    4055    EditMiddleName: TEdit;
    4156    EditTitleAfter: TEdit;
    42     EditEmailHome: TEdit;
    43     EditEmailWork: TEdit;
    4457    EditBirthday: TEdit;
    45     EditPhoneHome: TEdit;
    46     EditPhoneWork: TEdit;
    47     EditCellPhoneHome: TEdit;
    48     EditCellPhoneWork: TEdit;
    49     EditFax: TEdit;
    50     EditFaxHome: TEdit;
    51     EditFaxWork: TEdit;
    52     EditPager: TEdit;
    5358    EditLastName: TEdit;
    5459    EditEmail: TEdit;
    5560    EditPhone: TEdit;
    5661    EditFirstName: TEdit;
    57     EditCellPhone: TEdit;
    58     EditWebHome: TEdit;
     62    EditMobile: TEdit;
     63    EditWorkPhone: TEdit;
     64    GroupBox1: TGroupBox;
     65    GroupBox2: TGroupBox;
    5966    ImagePhoto: TImage;
    6067    Label1: TLabel;
     
    6471    Label13: TLabel;
    6572    Label14: TLabel;
     73    Label15: TLabel;
     74    Label16: TLabel;
     75    Label17: TLabel;
    6676    Label18: TLabel;
     77    Label19: TLabel;
    6778    Label2: TLabel;
    68     Label20: TLabel;
    69     Label21: TLabel;
    7079    Label22: TLabel;
    7180    Label23: TLabel;
     
    92101    Label42: TLabel;
    93102    Label43: TLabel;
     103    Label44: TLabel;
     104    Label45: TLabel;
     105    Label46: TLabel;
    94106    Label5: TLabel;
    95107    Label6: TLabel;
     
    103115    PageControlContact: TPageControl;
    104116    PopupMenu1: TPopupMenu;
     117    TabSheetOthers: TTabSheet;
     118    TabSheetHome: TTabSheet;
    105119    TabSheetWork: TTabSheet;
    106120    TabSheetGeneral: TTabSheet;
    107     TabSheetPrivate: TTabSheet;
    108121    TabSheetAll: TTabSheet;
    109122    procedure ButtonOkClick(Sender: TObject);
     
    215228  FormProperties.Properties := Contact.Properties;
    216229
     230  // General
    217231  EditFullName.Text := Contact.Fields[cfFullName];
    218232  EditFirstName.Text := Contact.Fields[cfFirstName];
     
    221235  EditTitleAfter.Text := Contact.Fields[cfTitleAfter];
    222236  EditTitleBefore.Text := Contact.Fields[cfTitleBefore];
    223   EditCellPhone.Text := Contact.Fields[cfTelCell];
    224   EditPhoneHome.Text := Contact.Fields[cfTelHome];
    225   EditPhoneWork.Text := Contact.Fields[cfTelWork];
     237  EditNickName.Text := Contact.Fields[cfNickName];
    226238  EditEmail.Text := Contact.Fields[cfEmail];
    227   MemoNotes.Lines.Text := Contact.Fields[cfNote];
     239  EditPhone.Text := Contact.Fields[cfTel];
     240  EditMobile.Text := Contact.Fields[cfTelCell];
     241  EditFax.Text := Contact.Fields[cfTelFax];
     242  EditPager.Text := Contact.Fields[cfTelPager];
     243  EditBirthday.Text := Contact.Fields[cfDayOfBirth];
     244  EditAniversary.Text := Contact.Fields[cfAnniversary];
     245  EditWeb.Text := Contact.Fields[cfUrl];
     246
     247  // Home
     248  EditHomeEmail.Text := Contact.Fields[cfEmailHome];
     249  EditHomePhone.Text := Contact.Fields[cfTelHome];
     250  EditHomeMobile.Text := Contact.Fields[cfTelCellHome];
     251  EditHomeFax.Text := Contact.Fields[cfTelFaxHome];
     252  EditHomePager.Text := Contact.Fields[cfTelPagerHome];
     253  EditHomeAddressPostOfficeBox.Text := Contact.Fields[cfHomeAddressPostOfficeBox];
     254  EditHomeAddressStreet.Text := Contact.Fields[cfHomeAddressStreet];
     255  EditHomeAddressStreetExtended.Text := Contact.Fields[cfHomeAddressStreetExtended];
     256  EditHomeAddressCity.Text := Contact.Fields[cfHomeAddressCity];
     257  EditHomeAddressRegion.Text := Contact.Fields[cfHomeAddressRegion];
     258  EditHomeAddressCountry.Text := Contact.Fields[cfHomeAddressCountry];
     259  EditHomeAddressPostalCode.Text := Contact.Fields[cfHomeAddressPostalCode];
     260  EditHomeWeb.Text := Contact.Fields[cfUrlHome];
    228261
    229262  // Work
     263  EditWorkEmail.Text := Contact.Fields[cfEmailWork];
     264  EditWorkPhone.Text := Contact.Fields[cfTelWork];
     265  EditWorkMobile.Text := Contact.Fields[cfTelCellWork];
     266  EditWorkFax.Text := Contact.Fields[cfTelFaxWork];
     267  EditWorkPager.Text := Contact.Fields[cfTelPagerWork];
    230268  EditTitle.Text := Contact.Fields[cfTitle];
    231269  EditOrganization.Text := Contact.Fields[cfOrganization];
     
    238276  EditAddressWorkCountry.Text := Contact.Fields[cfWorkAddressCountry];
    239277  EditAddressWorkPostalCode.Text := Contact.Fields[cfWorkAddressPostalCode];
    240   EditWebHome.Text := Contact.Fields[cfUrlWork];
    241 
    242   // Private
    243   EditAddressHomePostOfficeBox.Text := Contact.Fields[cfHomeAddressPostOfficeBox];
    244   EditAddressHomeStreet.Text := Contact.Fields[cfHomeAddressStreet];
    245   EditAddressHomeStreetExtended.Text := Contact.Fields[cfHomeAddressStreetExtended];
    246   EditAddressHomeCity.Text := Contact.Fields[cfHomeAddressCity];
    247   EditAddressHomeRegion.Text := Contact.Fields[cfHomeAddressRegion];
    248   EditAddressHomeCountry.Text := Contact.Fields[cfHomeAddressCountry];
    249   EditAddressHomePostalCode.Text := Contact.Fields[cfHomeAddressPostalCode];
    250   EditWebHome.Text := Contact.Fields[cfUrlHome];
    251   EditBirthday.Text := Contact.Fields[cfDayOfBirth];
    252 
    253   EditEmailHome.Text := Contact.Fields[cfEmail];
     278  EditWorkWeb.Text := Contact.Fields[cfUrlWork];
     279
     280  // Others
     281  MemoNotes.Lines.Text := Contact.Fields[cfNote];
     282
    254283  ImagePhoto.Picture.Bitmap.Clear;
    255284  PhotoProperty := Contact.GetProperty(cfPhoto);
     
    288317procedure TFormContact.SaveData;
    289318begin
     319  // General
    290320  Contact.Fields[cfFullName] := EditFullName.Text;
    291321  Contact.Fields[cfMiddleName] := EditMiddleName.Text;
     
    294324  Contact.Fields[cfTitleAfter] := EditTitleAfter.Text;
    295325  Contact.Fields[cfTitleBefore] := EditTitleBefore.Text;
    296   Contact.Fields[cfTelCell] := EditCellPhone.Text;
    297   Contact.Fields[cfTelHome] := EditPhoneHome.Text;
    298   Contact.Fields[cfTelWork] := EditPhoneWork.Text;
     326  Contact.Fields[cfNickName] := EditNickName.Text;
    299327  Contact.Fields[cfEmail] := EditEmail.Text;
    300   Contact.Fields[cfNote] := MemoNotes.Lines.Text;
    301   Contact.Fields[cfEmail] := EditEmailHome.Text;
     328  Contact.Fields[cfTel] := EditPhone.Text;
     329  Contact.Fields[cfTelCell] := EditMobile.Text;
     330  Contact.Fields[cfTelFax] := EditFax.Text;
     331  Contact.Fields[cfTelPager] := EditPager.Text;
    302332  Contact.Fields[cfDayOfBirth] := EditBirthday.Text;
     333  Contact.Fields[cfAnniversary] := EditAniversary.Text;
     334  Contact.Fields[cfUrl] := EditWeb.Text;
     335
     336  // Home
     337  Contact.Fields[cfEmailHome] := EditHomeEmail.Text;
     338  Contact.Fields[cfTelHome] := EditHomePhone.Text;
     339  Contact.Fields[cfTelCellHome] := EditHomeMobile.Text;
     340  Contact.Fields[cfTelFaxHome] := EditHomeFax.Text;
     341  Contact.Fields[cfTelPagerHome] := EditHomePager.Text;
     342  Contact.Fields[cfHomeAddressPostOfficeBox] := EditHomeAddressPostOfficeBox.Text;
     343  Contact.Fields[cfHomeAddressStreet] := EditHomeAddressStreet.Text;
     344  Contact.Fields[cfHomeAddressStreetExtended] := EditHomeAddressStreetExtended.Text;
     345  Contact.Fields[cfHomeAddressCity] := EditHomeAddressCity.Text;
     346  Contact.Fields[cfHomeAddressRegion] := EditHomeAddressRegion.Text;
     347  Contact.Fields[cfHomeAddressCountry] := EditHomeAddressCountry.Text;
     348  Contact.Fields[cfHomeAddressPostalCode] := EditHomeAddressPostalCode.Text;
     349  Contact.Fields[cfUrlHome] := EditHomeWeb.Text;
    303350
    304351  // Work
     352  Contact.Fields[cfEmailWork] := EditWorkEmail.Text;
     353  Contact.Fields[cfTelWork] := EditWorkPhone.Text;
     354  Contact.Fields[cfTelCellWork] := EditWorkMobile.Text;
     355  Contact.Fields[cfTelFaxWork] := EditWorkFax.Text;
     356  Contact.Fields[cfTelPagerWork] := EditWorkPager.Text;
    305357  Contact.Fields[cfTitle] := EditTitle.Text;
    306358  Contact.Fields[cfOrganization] := EditOrganization.Text;
     
    313365  Contact.Fields[cfWorkAddressCountry] := EditAddressWorkCountry.Text;
    314366  Contact.Fields[cfWorkAddressPostalCode] := EditAddressWorkPostalCode.Text;
    315   Contact.Fields[cfUrlWork] := EditWebWork.Text;
    316 
    317   // Private
    318   Contact.Fields[cfHomeAddressPostOfficeBox] := EditAddressHomePostOfficeBox.Text;
    319   Contact.Fields[cfHomeAddressStreet] := EditAddressHomeStreet.Text;
    320   Contact.Fields[cfHomeAddressStreetExtended] := EditAddressHomeStreetExtended.Text;
    321   Contact.Fields[cfHomeAddressCity] := EditAddressHomeCity.Text;
    322   Contact.Fields[cfHomeAddressRegion] := EditAddressHomeRegion.Text;
    323   Contact.Fields[cfHomeAddressCountry] := EditAddressHomeCountry.Text;
    324   Contact.Fields[cfHomeAddressPostalCode] := EditAddressHomePostalCode.Text;
    325   Contact.Fields[cfUrlHome] := EditWebHome.Text;
     367  Contact.Fields[cfUrlWork] := EditWorkWeb.Text;
     368
     369  // Others
     370  Contact.Fields[cfNote] := MemoNotes.Lines.Text;
    326371end;
    327372
Note: See TracChangeset for help on using the changeset viewer.