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"));
        }
Exemple #2
0
        public ActionResult UrunSil(long?id)
        {
            if (Session["giris"] == null)
            {
                return(RedirectToAction("Giris", "Home"));
            }
            if (id.Value == 0)
            {
                return(RedirectToAction("Sattiklarim", "Profil"));
            }
            UrunYonetici uy = new UrunYonetici();

            uy.Delete(uy.Find(x => x.urunId == id));
            return(RedirectToAction("Sattiklarim", "Profil"));
        }