예제 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Person person = new Person
            {
                Id        = 1,
                Name      = tbName.Text,
                LastName  = tbLastName.Text,
                BirthDate = dtpBirthDay.Value,
                Weight    = Convert.ToInt32(mtbWeight.Text),
                Height    = Convert.ToInt32(mtbHeight.Text)
            };

            repo.Add(person);
            MessageBox.Show("OK");
            getResults_Click(sender, e);
        }
예제 #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            //Person person = new Person();
            //person.Name = tbName.Text;
            //person.LastName = tbLastname.Text;
            //person.BirthDate = dpBirthDate.Value;
            //person.Weight = Convert.ToInt32(mtbHeight.Text);
            //person.Height = Convert.ToInt32(mtbHeight.Text);

            Person person = new Person
            {
                Name      = tbName.Text,
                LastName  = tbLastname.Text,
                BirthDate = dpBirthDate.Value,
                Weight    = Convert.ToInt32(mtbWeight.Text),
                Height    = Convert.ToInt32(mtbHeight.Text)
            };

            repo.Add(person);
            MessageBox.Show("OK");       //mb tab tab
            getResults_Click(sender, e); //getResults_Click(null, null);
        }