示例#1
0
        public JsonResult HizliGoster(int id)
        {
            Urun urun = new Urun();

            urun.LoadFromID(id);
            return(Json(new { urun = urun }, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public JsonResult SepetEkle(int id, int miktar, int ekleCikar)
        {
            Urun urun = new Urun();

            urun.LoadFromID(id);
            Site.SetSepet(urun, miktar, ekleCikar == 1);
            int count = Site.GetSepet().Count;

            return(Json(new { urun = urun, miktar = miktar, durum = (ekleCikar == 1 ? "true" : "false"), count = count }, JsonRequestBehavior.AllowGet));
        }
示例#3
0
        public JsonResult FavoriEkle(int id)
        {
            Kullanici musteri = Site.GetMusteri();

            if (musteri != null)
            {
                Urun urun = new Urun();
                urun.LoadFromID(id);
                bool oldu = Site.SetFavori(urun);
                return(Json(new { resim = (urun.urunResimleri.Count > 0 ? urun.urunResimleri[0].resim : "yok.jpg"), durum = (oldu ? "true" : "false"), login = true }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { resim = "yok.jpg", durum = "false", login = false }, JsonRequestBehavior.AllowGet));
            }
        }
示例#4
0
        public ActionResult Product(int id = 0)
        {
            if (id == 0)
            {
                return(RedirectToAction("Index"));
            }

            Urun u = new Urun();

            if (!u.LoadFromID(id))
            {
                return(RedirectToAction("Index"));
            }

            ViewBag.urun = u;

            return(View());
        }
示例#5
0
        public ActionResult N11Yayinla(int urunID)
        {
            if (Session["kullaniciID"] == null)
            {
                return(RedirectToAction("Login"));
            }

            string mesaj = "Ürün N11'de Yayınlanmış/Güncellenmiştir...";

            N11 n11 = new N11();

            Urun urun = new Urun();

            urun.LoadFromID(urunID);
            urun.LoadEntegrasyonBilgi();

            long n11UrunID = 0;

            Int64.TryParse(urun.entegrasyonBilgi.n11UrunID.ToString(), out n11UrunID);

            if (n11UrunID == 0)
            {
                SaveProductResponse saveProductResponse = n11.SaveProduct(urun);
                if (saveProductResponse.result.status != "success")
                {
                    mesaj = saveProductResponse.result.errorMessage;
                }
            }
            else
            {
                UpdateProductBasicResponse updateProductBasicResponse = n11.UpdateProductBasic(urun);
                if (updateProductBasicResponse.result.status != "success")
                {
                    mesaj = updateProductBasicResponse.result.errorMessage;
                }
            }

            return(RedirectToAction("UrunDetay", new { id = urunID, hata = mesaj }));
        }