public JsonResult AuctionAdd(teklif_miktarlari auc) { projeEntities1 db = new projeEntities1(); var urun = (from u in db.urunler where u.id == auc.urun_id select u).First(); DateTime localTime = DateTime.Now; DateTime startTime = Convert.ToDateTime(urun.baslangic_tarihi); DateTime finishTime = Convert.ToDateTime(urun.bitis_tarihi); if (localTime < startTime || localTime >= finishTime) { if (urun.teklif_durumu == "Evet") { urun.teklif_durumu = "Hayır"; db.SaveChanges(); } return(Json(false)); } AuctionDB aucDB = new AuctionDB(); return(Json(aucDB.AuctionAdd(auc), JsonRequestBehavior.AllowGet)); }