private void Add_Students_Click(object sender, EventArgs e) { this.Hide(); FromStudents f4 = new FromStudents(); f4.ShowDialog(); this.Close(); }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { con1.Open(); int UP_Row = int.Parse(e.RowIndex.ToString()); int UP_RowIndex = int.Parse(e.ColumnIndex.ToString()); ID1 = Convert.ToInt32(dataGridView1.Rows[UP_Row].Cells[0].Value.ToString()); int dd = (int)dataGridView1.CurrentRow.Cells[0].Value; if (UP_RowIndex == 8) { if (UP_RowIndex == 1) { if (UP_RowIndex == 0) { MessageBox.Show("Click Again"); } } if (UP_RowIndex != 0) { var askfirst1 = MessageBox.Show("Are you sure you want to add this student?", "Add", MessageBoxButtons.YesNo); if (askfirst1 == DialogResult.Yes) { AddGroupStudent s = new AddGroupStudent(dd); ID = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString()); s.textBox2.Text = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); s.Flagg2 = 0; s.ShowDialog(); con1.Close(); this.Close(); } else { con1.Close(); this.Hide(); FromStudents f2 = new FromStudents(); f2.ShowDialog(); } } } else { MessageBox.Show("Click on add button"); } }