private void PeriodPicker_SelectedIndexChanged(object sender, EventArgs e) { StudentScores.DataSource = OgrenciDAO.GetScoresForStudent(ogrenci.Id, Convert.ToInt32(PeriodPicker.Text)); StudentScores.AutoResizeColumns(); for (int i = 1; i < StudentScores.ColumnCount; i++) { StudentScores.Columns[i].ReadOnly = true; } }
private void StudentLessonRegister_Load(object sender, EventArgs e) { RegisterGrid.DataSource = OgrenciDAO.GetLessons(LoggedStudent.Donem, LoggedStudent.BolumId); RegisterLesson = RegisterGrid.DataSource as DataTable; for (int i = 1; i < RegisterGrid.ColumnCount; i++) { RegisterGrid.Columns[i].ReadOnly = true; } RegisterGrid.AutoResizeColumns(); }
private void OK_Click(object sender, EventArgs e) { try { if (!String.IsNullOrEmpty(StudentName.Text) && !String.IsNullOrEmpty(StudentNumber.Text) && !String.IsNullOrEmpty(StudentSurname.Text) && !String.IsNullOrEmpty(StudentUserName.Text)) { Ogrenci ogrenci = new Ogrenci { Ad = StudentName.Text, Soyad = StudentSurname.Text, Numara = StudentNumber.Text, Donem = 1, AlinanDersler = DersDAO.GetFirst(LoggedAcademican.BolumId), BolumId = LoggedAcademican.BolumId, FakulteId = LoggedAcademican.FakulteId }; if (Men.Checked == true) { ogrenci.Cinsiyet = true; } else { ogrenci.Cinsiyet = false; } ogrenci.KullaniciAdi = StudentUserName.Text; ogrenci.Sifre = Password.Encrypt(ogrenci.Numara); ogrenci.Aktif = true; ogrenci.Onay = true; ogrenci.OnceOnay = false; bool Result = OgrenciDAO.AddUpdateDeleteStudent(ogrenci, 0); if (Result == true) { MessageBox.Show("İşlem Başarı ile tamamlandı !", "Tamamlandı", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("Bir Hata oluştu", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Hatalı Giriş Yaptınız Lütfen Tekrar Deneyiniz !", "HATA !", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception err) { MessageBox.Show(err.Message); } }
private void LoadStudentGrid() { StudentGridView.DataSource = OgrenciDAO.GetData(LoggedAcademician.Id); StudentTable = StudentGridView.DataSource as DataTable; for (int i = 4; i < StudentGridView.ColumnCount; i++) { StudentGridView.Columns[i].ReadOnly = true; } for (int i = 0; i < StudentGridView.ColumnCount; i++) { StudentGridView.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; } StudentGridView.AutoResizeColumns(); }
private void ShowStudent_Load(object sender, EventArgs e) { DataTable dt = OgrenciDAO.GetOneStudentData(ogrenci); Names.Text = dt.Rows[0]["Ad"].ToString(); Surname.Text = dt.Rows[0]["Soyad"].ToString(); Number.Text = dt.Rows[0]["Numara"].ToString(); if (Convert.ToBoolean(dt.Rows[0]["Cinsiyet"]) == true) { Gender.Text = "Erkek"; } else { Gender.Text = "Kadın"; } Departman.Text = dt.Rows[0]["FakulteAd"].ToString(); Bolum.Text = dt.Rows[0]["BolumAd"].ToString(); }
private void StudentLogin_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(UserName.Text) && !String.IsNullOrEmpty(UserPass.Text)) { Ogrenci ogrenci = OgrenciDAO.LoginChecker(UserName.Text, UserPass.Text); if (ogrenci != null) { StudentScreen SS = new StudentScreen(); SS.LoginInfo(ogrenci); SS.Show(); this.Hide(); ogrenci = null; } else { MessageBox.Show("Yanlış Kullanıcı Adı veya Şifre girdiniz !", "Hatalı Şifre !", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } }
private void OK_Click(object sender, EventArgs e) { try { bool Result = OgrenciDAO.Approve(ogrenci); if (Result == true) { MessageBox.Show("İşlem Başarı ile tamamlandı !", "Tamamlandı", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("Bir Hata oluştu", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception Err) { MessageBox.Show(Err.Message); } }
private void OK_Click(object sender, EventArgs e) { List <string> Selected = new List <string>(); for (int i = 0; i < RegisterGrid.Rows.Count; i++) { bool IsChecked = Convert.ToBoolean(RegisterGrid.Rows[i].Cells["Checker"].Value); if (IsChecked == true) { int basamak = 0; int dummy = Convert.ToInt32(RegisterLesson.Rows[i]["Id"]); int real = dummy; while (dummy >= 1) { dummy /= 10; basamak++; } if (basamak == 1) { string Add = "0" + real.ToString(); Selected.Add(Add); } else { Selected.Add(RegisterLesson.Rows[i]["Id"].ToString()); } } } string Classes = string.Join("", Selected); bool Result = OgrenciDAO.AddLessons(LoggedStudent.Id, Classes); if (Result == true) { MessageBox.Show("İşlem başarılı !", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("Birşeyler Yanlış Gitti !", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void OK_Click(object sender, EventArgs e) { try { if (!String.IsNullOrEmpty(EditedNumber.Text) && !String.IsNullOrEmpty(EditedStudentName.Text) && !String.IsNullOrEmpty(EditedStudentSurname.Text)) { Ogrenci ogrenci = new Ogrenci { Id = ogrenciDTO.Id, Ad = EditedStudentName.Text, Soyad = EditedStudentSurname.Text, Numara = EditedNumber.Text }; if (Men.Checked == true) { ogrenci.Cinsiyet = true; } else { ogrenci.Cinsiyet = false; } bool Result = OgrenciDAO.AddUpdateDeleteStudent(ogrenci, 1); if (Result == true) { MessageBox.Show("İşlem Başarı ile tamamlandı !", "Tamamlandı", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("Bir Hata oluştu", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch (Exception err) { MessageBox.Show(err.Message); } }
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(); } }