示例#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;
 }