private void projectsGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { selectedrow = projectsGridView.CurrentCell.RowIndex; DataGridViewRow row = projectsGridView.Rows[selectedrow]; if (e.ColumnIndex == 3) { GeneralID.selectedObjectid = (int)row.Cells[0].Value; Add_Project add = new Add_Project(); this.Hide(); add.Show(); } else if (e.ColumnIndex == 4) { DialogResult dr = MessageBox.Show("Are you sure want delete this Project", "Delete Project", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr == DialogResult.OK) { int selectId = (int)row.Cells[0].Value; string deleteStudentQuery = string.Format("delete Project where Id='{0}'", selectId); DataBaseConnection.getInstance().executeQuery(deleteStudentQuery); MessageBox.Show("Project deleted Successfully"); this.load_data_in_gridview(); } } }
private void addProjectToolStripMenuItem_Click(object sender, EventArgs e) { Add_Project addProject = new Add_Project(); this.Hide(); addProject.Show(); }
private void picBxAddNew_Click(object sender, EventArgs e) { Add_Project add = new Add_Project(); this.Hide(); add.Show(); }