private void AddEMail() { EMails.Add(new MailModel() { ID = 0, MailOfContact = EditableEMail }); }
public ContactModel GetContact() { Contact.PhoneNumbers = new List <PhoneNumberModel>(PhoneNumbers.ToList()); Contact.MailsOfContact = new List <MailModel>(EMails.ToList()); var newContact = _cloneService.CloneObject(Contact); return(_cloneService.CloneObject(Contact)); }
private bool CanEditEMail() { if (ErrorCollection.ContainsKey(nameof(EditableEMail))) { return(false); } if (string.IsNullOrWhiteSpace(EditableEMail)) { return(false); } if (EMail == null) { return(false); } if (EMails.FirstOrDefault(m => m.MailOfContact.Equals(EditableEMail)) == null) { return(true); } return(false); }
private bool HasChanges() { return(Contact.WasModelChanged || PhoneNumbers.Any(p => p.WasModelChanged) || EMails.Any(e => e.WasModelChanged)); }