public JsonResult SepetleriSil()
 {
     Kullanici klnc = Session["giris"] as Kullanici;
     SepetYonetici sy = new SepetYonetici();
     if (klnc != null)
     {
         List<Sepet> sptler = sy.List(x => x.kullaniciId == klnc.kullaniciId);
         for (int i = 0; i < sptler.Count; i++)
         {
             if (sptler[i].faturaId == null)
             {
                 sy.Delete(sptler[i]);
             }
         }
     }
     return Json("deneme1");
 }
        public ActionResult UrunleriSil()
        {
            List <Sepet> sptler = spy.List();

            for (int i = 0; i < sptler.Count; i++)
            {
                if (sptler[i].faturaId == null)
                {
                    spy.Delete(sptler[i]);
                }
            }
            List <Urun> urnler = uy.List();

            foreach (Urun item in urnler)
            {
                uy.Delete(item);
            }

            return(RedirectToAction("UrunYonetim"));
        }
 public JsonResult SepetSil(long Id)
 {
     Kullanici klnc = Session["giris"] as Kullanici;
     if (klnc != null)
     {
         int sayi = 0;
         UrunYonetici uy = new UrunYonetici();
         SepetYonetici sy = new SepetYonetici();
         List<Sepet> sptler = sy.List(x => x.kullaniciId == klnc.kullaniciId);
         Urun urn = uy.Find(x => x.ilanId == Id);
         for (int i = 0; i < sptler.Count; i++)
         {
             if (sptler[i].urunId == urn.urunId)
                 sayi++;
         }
         if (sayi != 0)
         {
             Sepet spt = sy.Find(x => x.urunId == urn.urunId);
             sy.Delete(spt);
         }
     }
     return Json("deneme1");
 }