private void AddContactClick(object sender, RoutedEventArgs e) { var newPerson = new Person(); People.Add(newPerson); DatabaseAccess.SaveOrUpdate(newPerson); NotifyPropertyChanged("People"); peopleGrid.SelectedValue = newPerson; }
public Company() { Name = String.Empty; TaxNumber = String.Empty; Addresses = new List<Address>(); RepresentedBy = new Person(); ServedBy = new Person(); Employees = new List<Person>(); Phones = new List<PhoneNumber>(); WebAddress = String.Empty; EmailAddress = String.Empty; }
public virtual void SetValues(Person sourceValues) { if (sourceValues == null) { return; } ID = sourceValues.ID; Name = sourceValues.Name; Surname = sourceValues.Surname; PersonalID = sourceValues.PersonalID; TaxNumber = sourceValues.TaxNumber; Picture = sourceValues.Picture; Addresses = new List<Address>(); Phones = new List<PhoneNumber>(); this.Addresses = sourceValues.Addresses; this.Phones = sourceValues.Phones; }
public virtual object Clone() { var clonedPerson = new Person { ID = this.ID, Name = this.Name, Surname = this.Surname, PersonalID = this.PersonalID, TaxNumber = this.TaxNumber, Picture = this.Picture, Addresses = new List<Address>(), Phones = new List<PhoneNumber>() }; foreach (var address in this.Addresses) { clonedPerson.Addresses.Add((Address)address.Clone()); } foreach (var phone in this.Phones) { clonedPerson.Phones.Add((PhoneNumber)phone.Clone()); } return clonedPerson; }
private Person CreateNewPerson() { var newPerson = new Person(); DatabaseAccess.SaveOrUpdate(newPerson); return newPerson; }
private void EditButtonClick(object sender, RoutedEventArgs e) { EditMode = true; preEditData = ContactData.Clone() as Person; }
private void RebindContact() { var temp = ContactData; ContactData = null; ContactData = temp; }