private void StudentGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow row = StudentGridView.CurrentRow; if (StudentGridView.CurrentCell.ColumnIndex == 0) { ShowScoresHeadScreen SSHS = new ShowScoresHeadScreen(); SSHS.GetInfo(LoggedAcademician.BolumId, Convert.ToInt32(StudentTable.Rows[row.Index]["Id"])); SSHS.ShowDialog(); LoadStudentGrid(); } else if (StudentGridView.CurrentCell.ColumnIndex == 1) { if (Convert.ToBoolean(row.Cells["Onay"].Value) == true) { MessageBox.Show("Bu öğrencinin dersleri zaten onaylanmış", "Zaten", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Ogrenci ogrenci = new Ogrenci { Id = Convert.ToInt32(StudentTable.Rows[row.Index]["Id"]), Onay = true, AlinanDersler = StudentTable.Rows[row.Index]["AlinanDersler"].ToString() }; ApprovingScreen AS = new ApprovingScreen(); AS.GetInfo(ogrenci); AS.ShowDialog(); LoadStudentGrid(); } } else if (StudentGridView.CurrentCell.ColumnIndex == 2) { DialogResult dialogResult = MessageBox.Show(row.Cells["Ad"].Value.ToString() + " Adlı öğrenci kalıcı olarak silinecek", "Emin Misin ?", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (dialogResult == DialogResult.OK) { Ogrenci ogrenci = new Ogrenci { Aktif = false, Id = Convert.ToInt32(StudentTable.Rows[row.Index]["Id"]) }; bool Result = OgrenciDAO.AddUpdateDeleteStudent(ogrenci, 2); if (Result == true) { MessageBox.Show("Silme İşlemi Başarı İle Tamamlandı !", "GONE FOREVER (!)", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadStudentGrid(); } else { MessageBox.Show("Birşeyler Yanlış Gitti !", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("İptal Edildi !", "İptal", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else if (StudentGridView.CurrentCell.ColumnIndex == 3) { OgrenciDTO ogrenciDTO = new OgrenciDTO { Id = Convert.ToInt32(StudentTable.Rows[row.Index]["Id"]), Ad = row.Cells["Ad"].Value.ToString(), Soyad = row.Cells["Soyad"].Value.ToString(), Numara = row.Cells["Numara"].Value.ToString(), Cinsiyet = Convert.ToBoolean(row.Cells["Cinsiyet"].Value) }; UpdateStudent US = new UpdateStudent(); US.GetInfo(ogrenciDTO); US.ShowDialog(); LoadStudentGrid(); } }
public void GetInfo(OgrenciDTO Info) { ogrenciDTO = Info; }