Esempio n. 1
0
        public void Execute(object parameter)
        {
            var personManager = new PersonManager();

            if (parameter is Person person && personManager.Add(new Person
            {
                LastName = person.LastName,
                Name = person.Name,
                Email = person.Email,
                DateOfBirth = person.DateOfBirth
            }))
            {
                MessageBox.Show("Person Add Successful !");
            }
        }
Esempio n. 2
0
        public void Add(object obj)
        {
            var person = new Person {
                LastName = LastName, Name = Name, Email = Email, DateOfBirth = DateOfBirth
            };

            if (PersonManager.Add(person))
            {
                Persons.Add(person);
                ResetPerson();
                MessageBox.Show("Person Add Successful !");
            }
            else
            {
                MessageBox.Show("Person with this ID already exists !");
            }
        }