public ActionResult ParaYukle(ParaViewModel para) { var Hesaplar = db.tbl_Hesaplar.Where(t => t.musteriNo == User.Identity.Name && t.aktiflik == true).ToList(); ViewBag.yuklenicekHesap = new SelectList(Hesaplar, "hesapId", "hesapNumarasi"); var hesap = db.tbl_Hesaplar.FirstOrDefault(i => i.hesapId == para.hesapNo && i.musteriNo == User.Identity.Name); hesap.bakiye = hesap.bakiye + para.bakiye; db.SaveChanges(); return(View()); }
public ActionResult ParaCek(ParaViewModel para) { var Hesaplar = db.tbl_Hesaplar.Where(t => t.musteriNo == User.Identity.Name && t.aktiflik == true).ToList(); ViewBag.cekilecekHesap = new SelectList(Hesaplar, "hesapId", "hesapNumarasi"); var hesap = db.tbl_Hesaplar.FirstOrDefault(i => i.hesapId == para.hesapNo && i.musteriNo == User.Identity.Name); if (hesap.bakiye < para.bakiye) { return(HttpNotFound("Bakiye Yetersiz!!!")); } hesap.bakiye = hesap.bakiye - para.bakiye; db.SaveChanges(); return(View()); }