public ActionResult sepetcikar(int urunId, int adet) //Ajax { int Kullanici = int.Parse(Session["Login"].ToString()); var gonder = SepetRepo.SanalSepeteCikar(Kullanici, urunId, adet); return(Json(gonder, JsonRequestBehavior.AllowGet)); }
public ActionResult SepetKontrol() //Ajax { int Kullanici = int.Parse(Session["User"].ToString()); var gonder = SepetRepo.SanalSepeteListe(Kullanici); return(Json(gonder, JsonRequestBehavior.AllowGet)); }
public ActionResult SiparisOlustur(string Gorev, int?UyelerID) { if (Session["Login"] != null) { try { int ID = int.Parse(Session["Login"].ToString()); if (Gorev == "Sil") { bool sonuc = SepetRepo.SepetiSilKullanici(ID); if (sonuc == false) { TempData["Hata"] = "Database Bağlantısı Sağlanamadı! Elle Sipariş Silme İşlemi Başarısız"; TempData["HataKodu"] = "19921"; return(RedirectToAction("Hata", "Product")); } } else if (Gorev == "Kaydet") { bool sonuc = SepetRepo.SepetiKaydetKullanici(ID, UyelerID.ToString()); if (sonuc == false) { TempData["Hata"] = "Database Bağlantısı Sağlanamadı! Elle Sipariş Kaydetme İşlemi Başarısız"; TempData["HataKodu"] = "19911"; return(RedirectToAction("Hata", "Product")); } } bool kontrol = SepetRepo.SanalSepetKontrol(ID); if (kontrol == true) { ViewBag.ID = ID; TempData["UyariTipi"] = "alert alert-danger"; TempData["Uyari"] = false; TempData["Sonuc"] = "Sipariş Sepetinde Daha Önceden Kaydedilmiş Ürünler Bulunmaktadır."; } return(RedirectToAction("SiparisOlustur")); } catch { TempData["Hata"] = "Database Bağlantısı Sağlanamadı!"; TempData["HataKodu"] = "1711"; return(RedirectToAction("Hata", "Product")); } } else { TempData["UyariTipi"] = "text-danger"; TempData["Sonuc"] = "Tarayıcıda Oturum Süreniz Dolmuş! Lütfen Tekrar Oturum Açın!"; return(RedirectToAction("Login", "Admin")); } }
public ActionResult UrunSepetCikar(string Malzemekodu) //Ajax { int Kullanici = int.Parse(Session["User"].ToString()); var gonder = SepetRepo.SanalSepeteCikar(Kullanici, Malzemekodu); if (gonder != false) { return(Json(new { success = true, responseText = "Bu Ürün Başarıyla Güncellendi" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, responseText = "Ürün Güncelleme Başarısız Oldu!" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult sepetekle(string Malzemekodu, double Fiyat, int Adet) //Ajax { int Kullanici = int.Parse(Session["User"].ToString()); var gonder = SepetRepo.SanalSepeteEkle(Kullanici, Malzemekodu, Adet, Fiyat); if (gonder != false) { return(Json(new { success = true, responseText = "Ürün Sepete Eklendi!" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, responseText = "Sepete Ürün Ekleme Başarısız Oldu!" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult SiparisIptal() { if (Session["User"] != null) { int id = int.Parse(Session["User"].ToString()); SepetRepo.SepetiSilKullanici(id); return(RedirectToAction("Satis")); } else { TempData["UyariTipi"] = "text-danger"; TempData["Sonuc"] = "Tarayıcıda Oturum Süreniz Dolmuş! Lütfen Tekrar Oturum Açın!"; return(RedirectToAction("Logon", "Login")); } }
public ActionResult SiparisOlustur() { if (Session["Login"] != null) { try { var Gonder = UrunRepo.UrunleriBul(); int ID = int.Parse(Session["Login"].ToString()); bool kontrol = SepetRepo.SanalSepetKontrol(ID); if (kontrol == true) { ViewBag.ID = ID; TempData["UyariTipi"] = "alert alert-danger"; TempData["Uyari"] = false; TempData["Sonuc"] = "Sipariş Sepetinde Daha Önceden Kaydedilmiş Ürünler Bulunmaktadır."; } else { ViewBag.ID = 0; } return(View(Gonder)); } catch { TempData["Hata"] = "Database Bağlantısı Sağlanamadı!"; TempData["HataKodu"] = "1711"; return(RedirectToAction("Hata", "Product")); } } else { TempData["UyariTipi"] = "text-danger"; TempData["Sonuc"] = "Tarayıcıda Oturum Süreniz Dolmuş! Lütfen Tekrar Oturum Açın!"; return(RedirectToAction("Login", "Admin")); } }
public ActionResult sepetlistelekullanicilar(int ID) //Ajax { var gonder = SepetRepo.SanalSepeteListe(ID); return(Json(gonder, JsonRequestBehavior.AllowGet)); }