예제 #1
0
 private void AddContactClick(object sender, RoutedEventArgs e)
 {
     var newPerson = new Person();
     People.Add(newPerson);
     DatabaseAccess.SaveOrUpdate(newPerson);
     NotifyPropertyChanged("People");
     peopleGrid.SelectedValue = newPerson;
 }
예제 #2
0
파일: Company.cs 프로젝트: badamiak/Prm
        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;

        }
예제 #3
0
파일: Person.cs 프로젝트: badamiak/Prm
 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;
 }
예제 #4
0
파일: Person.cs 프로젝트: badamiak/Prm
        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;
        }
예제 #5
0
 private Person CreateNewPerson()
 {
     var newPerson = new Person();
     DatabaseAccess.SaveOrUpdate(newPerson);
     return newPerson;
 }
예제 #6
0
 private void EditButtonClick(object sender, RoutedEventArgs e)
 {
     EditMode = true;
     preEditData = ContactData.Clone() as Person;
 }
예제 #7
0
 private void RebindContact()
 {
     var temp = ContactData;
     ContactData = null;
     ContactData = temp;
 }