Example #1
0
        private void btnSınavKaydet_Click(object sender, EventArgs e)
        {
            try
            {
                Notlar nt = new Notlar();
                nt.Vize      = Convert.ToInt32(txt1Vize.Text);
                nt.Sozlu     = Convert.ToInt32(txtSozlu.Text);
                nt.Final     = Convert.ToInt32(txtFinal.Text);
                nt.Ortalama  = Convert.ToInt32(txtOrtalama.Text);
                nt.OgrenciId = Convert.ToInt32(txtGelenOgrId.Text);
                nt.DerslerId = Convert.ToInt32(txtGelenDersId.Text);
                bool sonuc7 = NotlarBL.NotlarıEkle(nt);
                if (sonuc7)
                {
                    MessageBox.Show("Not Kaydedildi");
                    NotlarListele();
                    Utility.CleanTextBoxes(grpNotEkleme.Controls);
                }
                else
                {
                    MessageBox.Show("Not Kaydedilmedi!!");
                }
            }
            catch (Exception)
            {
                throw;
            }
            #region MyRegion
            //Notlar nt = new Notlar();
            //foreach (DataRow item in dt1.Rows)
            //{
            //    switch (item.RowState)
            //    {
            //        case DataRowState.Added:
            //            nt.Vize = Convert.ToInt32(item["Vize"]);
            //            nt.Sozlu = Convert.ToInt32(item["Sozlu"]);
            //            nt.Final = Convert.ToInt32(item["Final"]);
            //            nt.Ortalama = Convert.ToInt32(item["Ortalama"]);
            //            nt.OgrenciId = Convert.ToInt32(txtGelenOgrId.Text);
            //            nt.DerslerId = Convert.ToInt32(txtGelenDersId.Text);
            //            NotlarBL.NotlarıEkle(nt);
            //            break;
            //        case DataRowState.Deleted:
            //            nt.NotlarId = Convert.ToInt32(item["NotlarId", DataRowVersion.Original]);
            //            NotlarBL.NotlarıSil(nt.NotlarId);
            //            break;
            //        case DataRowState.Modified:
            //            nt.Vize = Convert.ToInt32(item["Vize"]);
            //            nt.Sozlu = Convert.ToInt32(item["Sozlu"]);
            //            nt.Final = Convert.ToInt32(item["Final"]);
            //            nt.Ortalama = Convert.ToInt32(item["Ortalama"]);
            //            NotlarBL.NotlarıDuzenleme(nt);
            //            break;
            //        default:
            //            break;
            //    }

            //}
            #endregion
        }
Example #2
0
        private void btnNotDuzenle_Click(object sender, EventArgs e)
        {
            try
            {
                Notlar nt = new Notlar();
                nt.Vize      = Convert.ToInt32(txt1Vize.Text);
                nt.Sozlu     = Convert.ToInt32(txtSozlu.Text);
                nt.Final     = Convert.ToInt32(txtFinal.Text);
                nt.Ortalama  = Convert.ToInt32(txtOrtalama.Text);
                nt.OgrenciId = Convert.ToInt32(txtGelenOgrId.Text);
                nt.DerslerId = Convert.ToInt32(txtGelenDersId.Text);
                nt.NotlarId  = Convert.ToInt32(txtGelenNotId.Text);
                bool sonuc7 = NotlarBL.NotlarıDuzenleme(nt);
                if (sonuc7)
                {
                    MessageBox.Show("Notlar Güncellendi");
                    NotlarListele();
                    Utility.CleanTextBoxes(grpNotEkleme.Controls);
                }
                else
                {
                    MessageBox.Show("Notlar Güncellenmedi!!");
                }
            }

            catch (Exception)
            {
                throw;
            }
        }
Example #3
0
 private void btnNotSil_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult dialog = MessageBox.Show("Öğrencinin Notlarını Silmek Üzeresiniz!!!", "UYARI", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
         if (dialog == DialogResult.OK)
         {
             Notlar nt = new Notlar();
             nt.NotlarId = Convert.ToInt32(txtGelenNotId.Text);
             bool sonuc8 = NotlarBL.NotlarıSil(nt.NotlarId);
             if (sonuc8)
             {
                 MessageBox.Show("Notlar Silindi");
                 NotlarListele();
                 Utility.CleanTextBoxes(grpNotEkleme.Controls);
             }
             else
             {
                 MessageBox.Show("İşlem Başarısız!!");
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #4
0
 void NotlarListele()
 {
     dt1 = NotlarBL.NotlarListesi();
     grdNotlar.DataSource = dt1;
 }