Exemplo n.º 1
0
        private void BtnAddVehicle_Click(object sender, EventArgs e)
        {
            AddEditVehicle editStaff = new AddEditVehicle(0, AddEditVehicle.FormMode.Add);

            editStaff.ShowDialog();
            setUpDataGridView();
        }
Exemplo n.º 2
0
        private void DgvVehicleRoster_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView senderGrid = (DataGridView)sender;
            DialogResult result;

            if (e.ColumnIndex < 0)
            {
                return;
            }
            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
            {
                string action = e.ColumnIndex == 1 ? "Edit" : "Remove";
                //result = MessageBox.Show(dgvStaff.Rows[e.RowIndex].Cells[2].Value.ToString(), "Selected Staff to " + action);
                // Edit vehicle
                if (e.ColumnIndex == 1)
                {
                    AddEditVehicle editStaff = new AddEditVehicle((int)dgvVehicleRoster.Rows[e.RowIndex].Cells[0].Value, AddEditVehicle.FormMode.Edit);
                    editStaff.ShowDialog();
                }
                else // Remove Vehicle member * Should really never have to remove a staff member.
                {
                }

                setUpDataGridView();
            }
        }