Example #1
0
        private void LessonGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow row = LessonGridView.CurrentRow;

            if (LessonGridView.CurrentCell.ColumnIndex == 1)
            {
                DersDTO dersDTO = new DersDTO
                {
                    Ad            = row.Cells["Ad"].Value.ToString(),
                    Id            = Convert.ToInt32(dt.Rows[row.Index]["Id"]),
                    FakulteAd     = row.Cells["FakulteAd"].Value.ToString(),
                    BolumAd       = row.Cells["BolumAd"].Value.ToString(),
                    AkademisyenId = Convert.ToInt32(dt.Rows[row.Index]["AkademisyenId"]),
                    AkademisyenAd = row.Cells["AkademisyenAd"].Value.ToString(),
                    Kredi         = Convert.ToByte(row.Cells["Kredi"].Value),
                    Donem         = Convert.ToInt32(row.Cells["Donem"].Value),
                    BolumId       = LoggedAcademician.BolumId
                };
                UpdateLessonScreen ULS = new UpdateLessonScreen();
                ULS.GetInfo(dersDTO);
                ULS.ShowDialog();
                LoadGrid();
            }
            else if (LessonGridView.CurrentCell.ColumnIndex == 0)
            {
                DialogResult dialogResult = MessageBox.Show(row.Cells["Ad"].Value.ToString() + " Adlı ders kalıcı olarak silinecek", "Emin Misin ?", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                if (dialogResult == DialogResult.OK)
                {
                    Ders ders = new Ders
                    {
                        Aktif = false,
                        Id    = Convert.ToInt32(dt.Rows[row.Index]["Id"])
                    };
                    bool Result = DersDAO.AddUpdateDeleteLesson(ders, 2);
                    if (Result == true)
                    {
                        MessageBox.Show("Silme İşlemi Başarı İle Tamamlandı !", "GONE FOREVER (!)", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        LoadGrid();
                    }
                    else
                    {
                        MessageBox.Show("Birşeyler Yanlış Gitti !", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show("İptal Edildi !", "İptal", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Example #2
0
 public void GetInfo(DersDTO Info)
 {
     dersDTO = Info;
 }