Exemplo n.º 1
0
 public ActionResult NotGetir(Class1 model, TBL_Notlar p, int sınav1 = 0, int sınav2 = 0, int sınav3 = 0, int proje = 0)
 {
     if (model.islem == "Hesapla")
     {
         int ortalama = (sınav1 + sınav2 + sınav3 + proje) / 4;
         ViewBag.ort = ortalama;
     }
     if (model.islem == "Guncelle")
     {
         var not = db.TBL_Notlar.Find(p.NOTID);
         not.SINAV1   = p.SINAV1;
         not.SINAV2   = p.SINAV2;
         not.SINAV3   = p.SINAV3;
         not.PROJE    = p.PROJE;
         not.ORTALAMA = p.ORTALAMA;
         not.DURUM    = p.DURUM;
         db.SaveChanges();
         return(RedirectToAction("Index", "Notlar"));
     }
     return(View());
 }
Exemplo n.º 2
0
 public ActionResult NotGiris(TBL_Notlar p)
 {
     db.TBL_Notlar.Add(p);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }