Example #1
0
        private void btnAddPerson_Click(object sender, EventArgs e)
        {
            //open up the person form
            personStuff personThings = new personStuff();

            //activate the form so that it can be seen
            personThings.ShowDialog();
        }
        private void dgvPersonSearch_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //collect information
            string strId = dgvPersonSearch.Rows[e.RowIndex].Cells[0].Value.ToString();

            //test this with pop up
            //MessageBox.Show(strId);

            //convert string to integer
            int intId = Convert.ToInt32(strId);

            //create an instance of the editor form with this id using the overloaded constructor
            personStuff editor = new personStuff(intId);

            editor.ShowDialog();

            //after the editing/deleting is done, rerun the search to refresh the data grid view
            btnPersonSearch.PerformClick();
        }