Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AddEditInmate addInmate = new AddEditInmate(0, AddEditInmate.FormMode.Add);

            //addInmate.Show();
            //this.Close();

            addInmate.AddEditInmateUpdated += AddInmate_AddEditInmateUpdated;
            addInmate.ShowDialog();
        }
Пример #2
0
        private void dgvCampRoster_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0)
            {
                return;
            }
            DataGridView senderGrid = (DataGridView)sender;

            //DialogResult result;
            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
            {
                //result = MessageBox.Show(dgvCampRoster.Rows[e.RowIndex].Cells[0].Value.ToString(), "Selected Inmate");
                AddEditInmate editInmate = new AddEditInmate((int)dgvCampRoster.Rows[e.RowIndex].Cells[0].Value, AddEditInmate.FormMode.Edit);
                editInmate.AddEditInmateUpdated += AddInmate_AddEditInmateUpdated;

                editInmate.ShowDialog();
                setUpDataGridView();
            }
        }