Example #1
0
 public ActionResult Kayit(Hesap Hesap)
 {
     using (BankaEntities db = new BankaEntities())
     {
         if (Hesap.Id == 0)//ekleme
         {
             db.Hesaps.Add(Hesap);
         }
         else //güncelle
         {
             db.Entry(Hesap).State = System.Data.Entity.EntityState.Modified;
         }
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
 }
Example #2
0
 public ActionResult Profilim(Kullanici Kullanici)
 {
     using (BankaEntities db = new BankaEntities())
     {
         if (Kullanici.Id == 0)//ekleme
         {
             db.Kullanicis.Add(Kullanici);
         }
         else //güncelle
         {
             db.Entry(Kullanici).State = System.Data.Entity.EntityState.Modified;
         }
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
 }