Example #1
0
 private void Edit()
 {
     if (this.dataGridViewBindingList.SelectedRows.Count > 0)
     {
         person _selectedPerson = (person)this.dataGridViewBindingList.SelectedRows[0].DataBoundItem;
         Frmadd FormAdd         = new Frmadd(_selectedPerson);
         FormAdd.ShowDialog();
     }
 }
Example #2
0
        private void Add()
        {
            person _newPerson = new person();

            _newPerson.name        = "Ad giriniz";
            _newPerson.surname     = "Soyad giriniz";
            _newPerson.dateofBirth = DateTime.Now;
            Frmadd FormAdd = new Frmadd(_newPerson);

            if (FormAdd.ShowDialog() == DialogResult.OK)
            {
                foreach (person lastperson in persons)
                {
                    lastID = lastperson.id + 1;
                }
                _newPerson.id = lastID;
                persons.Add(_newPerson);
                logger.Debug("Person eklendi");
            }
        }