Пример #1
0
 public void Addperson(BindingList <Person> personList)
 {
     person = new Person();
     frmAdd = new frmAdd(person);
     if (frmAdd.ShowDialog() == DialogResult.OK)
     {
         personList.Add(person);
         MessageBox.Show("New person addedd.");
     }
     frmAdd.Dispose();
 }
Пример #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Person person = new Person();
            frmAdd frm    = new frmAdd(person);

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                personList.Add(person);
                MessageBox.Show("New person addedd.");
            }
            frm.Dispose();
        }
Пример #3
0
 public void Editperson(BindingList <Person> personList, DataGridView dataGrid)
 {
     if (dataGrid.SelectedRows.Count > 0)
     {
         person = personList[dataGrid.SelectedRows[0].Index];
         frmAdd frmAdd = new frmAdd(person);
         if (frmAdd.ShowDialog() == DialogResult.OK)
         {
             MessageBox.Show("İnformation updated");
         }
         frmAdd.Dispose();
     }
     else
     {
         MessageBox.Show("Select the person you want to edit");
     }
 }
Пример #4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Person person;

            if (dgwListe.SelectedRows.Count > 0)
            {
                person = personList[dgwListe.SelectedRows[0].Index];
                frmAdd frm = new frmAdd(person);
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    MessageBox.Show("İnformation updated");
                }
                frm.Dispose();
            }
            else
            {
                MessageBox.Show("Select the person you want to edit");
            }
        }