Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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());
        }