private void btnDelete_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Are you sure you wanna delete this? ", "Computer Parts", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { int index = this.gridManageComputers.Rows.IndexOf((GridViewDataRowInfo)this.gridManageComputers.CurrentRow); if (index < 0) { return; } BO.Computer computer = (BO.Computer)gridManageComputers.Rows[index].DataBoundItem; if (index != null) { _computersBll.Remove(computer.ComputerID); } } else if (dialogResult == DialogResult.No) { this.Hide(); ManageComputers mg = new ManageComputers(); mg.ShowDialog(); } }
private void btnRefresh_Click(object sender, EventArgs e) { this.Hide(); ManageComputers mg = new ManageComputers(); mg.ShowDialog(); }