public ActionResult KonsolDuzenle(Konsol t, HttpPostedFileBase file) { try { using (AdaGameContext context = new AdaGameContext()) { var _konsolDuzenle = context.Konsol.Where(x => x.ID == t.ID).FirstOrDefault(); if (file != null && file.ContentLength > 0) { MemoryStream memoryStream = file.InputStream as MemoryStream; if (memoryStream == null) { memoryStream = new MemoryStream(); file.InputStream.CopyTo(memoryStream); } _konsolDuzenle.KonsolFoto = memoryStream.ToArray(); } _konsolDuzenle.KonsolAdi = t.KonsolAdi; _konsolDuzenle.Fiyat = t.Fiyat; _konsolDuzenle.Tip = t.Tip; context.SaveChanges(); return(RedirectToAction("Konsol", "Admin")); } } catch (Exception ex) { throw new Exception("Güncellerken hata oluştu " + ex.Message); } }
public ActionResult SlideEkle(Slider s, HttpPostedFileBase file) { try { using (AdaGameContext context = new AdaGameContext()) { Slider _slide = new Slider(); if (file != null && file.ContentLength > 0) { MemoryStream memoryStream = file.InputStream as MemoryStream; if (memoryStream == null) { memoryStream = new MemoryStream(); file.InputStream.CopyTo(memoryStream); } _slide.SliderFoto = memoryStream.ToArray(); } _slide.SliderText = s.SliderText; _slide.BaslangicTarih = s.BaslangicTarih; _slide.BitisTarih = s.BitisTarih; context.Slider.Add(_slide); context.SaveChanges(); return(RedirectToAction("Slider", "Admin")); } } catch (Exception ex) { throw new Exception("Eklerken hata oluştu"); } }
public ActionResult UrunEkle(Urun t, HttpPostedFileBase file) { try { using (AdaGameContext context = new AdaGameContext()) { Urun _urun = new Urun(); if (file != null && file.ContentLength > 0) { MemoryStream memoryStream = file.InputStream as MemoryStream; if (memoryStream == null) { memoryStream = new MemoryStream(); file.InputStream.CopyTo(memoryStream); } _urun.Foto = memoryStream.ToArray(); } _urun.UrunAdi = t.UrunAdi; _urun.Fiyat = t.Fiyat; _urun.UrunIcerik = t.UrunIcerik; _urun.Tip = t.Tip; context.Urun.Add(_urun); context.SaveChanges(); return(RedirectToAction("Urun", "Admin")); } } catch (Exception ex) { throw new Exception("Eklerken hata oluştu"); } }
public ActionResult SlideDuzenle(Slider slide, HttpPostedFileBase file) { try { using (AdaGameContext context = new AdaGameContext()) { var _slideDuzenle = context.Slider.Where(x => x.ID == slide.ID).FirstOrDefault(); if (file != null && file.ContentLength > 0) { MemoryStream memoryStream = file.InputStream as MemoryStream; if (memoryStream == null) { memoryStream = new MemoryStream(); file.InputStream.CopyTo(memoryStream); } _slideDuzenle.SliderFoto = memoryStream.ToArray(); } _slideDuzenle.SliderText = slide.SliderText; _slideDuzenle.BaslangicTarih = slide.BaslangicTarih; _slideDuzenle.BitisTarih = slide.BitisTarih; context.SaveChanges(); return(RedirectToAction("Slider", "Admin")); } } catch (Exception ex) { throw new Exception("Güncellerken hata oluştu " + ex.Message); } }
public ActionResult AksesuarEkle(Aksesuar b, HttpPostedFileBase file) { try { using (AdaGameContext context = new AdaGameContext()) { Aksesuar _aksesuar = new Aksesuar(); if (file != null && file.ContentLength > 0) { MemoryStream memoryStream = file.InputStream as MemoryStream; if (memoryStream == null) { memoryStream = new MemoryStream(); file.InputStream.CopyTo(memoryStream); } _aksesuar.AksesuarFoto = memoryStream.ToArray(); } _aksesuar.AksesuarAd = b.AksesuarAd; _aksesuar.AksesuarIcerik = b.AksesuarIcerik; _aksesuar.AksesuarFiyat = b.AksesuarFiyat; context.Aksesuar.Add(_aksesuar); context.SaveChanges(); return(RedirectToAction("Aksesuar", "Admin")); } } catch (Exception ex) { throw new Exception("Eklerken hata oluştu"); } }
public ActionResult AksesuarDuzenle(Aksesuar b, HttpPostedFileBase file) { try { using (AdaGameContext context = new AdaGameContext()) { var _aksesuarDuzenle = context.Aksesuar.Where(x => x.ID == b.ID).FirstOrDefault(); if (file != null && file.ContentLength > 0) { MemoryStream memoryStream = file.InputStream as MemoryStream; if (memoryStream == null) { memoryStream = new MemoryStream(); file.InputStream.CopyTo(memoryStream); } _aksesuarDuzenle.AksesuarFoto = memoryStream.ToArray(); } _aksesuarDuzenle.AksesuarAd = b.AksesuarAd; _aksesuarDuzenle.AksesuarIcerik = b.AksesuarIcerik; _aksesuarDuzenle.AksesuarFiyat = b.AksesuarFiyat; context.SaveChanges(); return(RedirectToAction("Aksesuar", "Admin")); } } catch (Exception ex) { throw new Exception("Güncellerken hata oluştu " + ex.Message); } }
public ActionResult KuponEkle(Kupon b, HttpPostedFileBase file) { try { using (AdaGameContext context = new AdaGameContext()) { Kupon _kupon = new Kupon(); if (file != null && file.ContentLength > 0) { MemoryStream memoryStream = file.InputStream as MemoryStream; if (memoryStream == null) { memoryStream = new MemoryStream(); file.InputStream.CopyTo(memoryStream); } _kupon.KuponFoto = memoryStream.ToArray(); } _kupon.KuponAd = b.KuponAd; _kupon.KuponIcerik = b.KuponIcerik; _kupon.KuponFiyat = b.KuponFiyat; context.Kupon.Add(_kupon); context.SaveChanges(); return(RedirectToAction("Kupon", "Admin")); } } catch (Exception ex) { throw new Exception("Eklerken hata oluştu"); } }
public ActionResult KonsolEkle(Konsol t, HttpPostedFileBase file) { try { using (AdaGameContext context = new AdaGameContext()) { Konsol _konsol = new Konsol(); if (file != null && file.ContentLength > 0) { MemoryStream memoryStream = file.InputStream as MemoryStream; if (memoryStream == null) { memoryStream = new MemoryStream(); file.InputStream.CopyTo(memoryStream); } _konsol.KonsolFoto = memoryStream.ToArray(); } _konsol.KonsolAdi = t.KonsolAdi; _konsol.Fiyat = t.Fiyat; _konsol.Tip = t.Tip; context.Konsol.Add(_konsol); context.SaveChanges(); return(RedirectToAction("Konsol", "Admin")); } } catch (Exception ex) { throw new Exception("Eklerken hata oluştu"); } }
public ActionResult SlideDuzenle(int SlideID) { using (AdaGameContext context = new AdaGameContext()) { var _slideDuzenle = context.Slider.Where(x => x.ID == SlideID).FirstOrDefault(); return(View(_slideDuzenle)); } }
public ActionResult Urun() { using (AdaGameContext context = new AdaGameContext()) { var urun = context.Urun.ToList(); return(View(urun)); } }
public ActionResult Aksesuar() { using (AdaGameContext context = new AdaGameContext()) { List <Aksesuar> aksesuar = context.Aksesuar.OrderBy(x => x.AksesuarAd).ToList(); return(View(aksesuar)); } }
public ActionResult Aksesuar() { using (AdaGameContext context = new AdaGameContext()) { var aksesuar = context.Aksesuar.ToList(); return(View(aksesuar)); } }
public ActionResult Slider() { using (AdaGameContext context = new AdaGameContext()) { var slider = context.Slider.ToList(); return(View(slider)); } }
public ActionResult Kupon() { using (AdaGameContext context = new AdaGameContext()) { var kupon = context.Kupon.ToList(); return(View(kupon)); } }
public ActionResult UrunDuzenle(int UrunID) { using (AdaGameContext context = new AdaGameContext()) { var _urunDuzenle = context.Urun.Where(x => x.ID == UrunID).FirstOrDefault(); return(View(_urunDuzenle)); } }
public ActionResult KonsolDetails(int KonsolID) { using (AdaGameContext context = new AdaGameContext()) { Konsol konsolDetails = context.Konsol.FirstOrDefault(x => x.ID == KonsolID); return(View(konsolDetails)); } }
public ActionResult KuponDetails(int KuponID) { using (AdaGameContext context = new AdaGameContext()) { Kupon kuponDetails = context.Kupon.FirstOrDefault(x => x.ID == KuponID); return(View(kuponDetails)); } }
public ActionResult AksesuarDetails(int AksesuarID) { using (AdaGameContext context = new AdaGameContext()) { Aksesuar aksesuarDetails = context.Aksesuar.FirstOrDefault(x => x.ID == AksesuarID); return(View(aksesuarDetails)); } }
public ActionResult OyunDetails(int UrunID) { using (AdaGameContext context = new AdaGameContext()) { Urun oyunDetails = context.Urun.FirstOrDefault(x => x.ID == UrunID); return(View(oyunDetails)); } }
public ActionResult AksesuarDuzenle(int AksesuarID) { using (AdaGameContext context = new AdaGameContext()) { var _aksesuarDuzenle = context.Aksesuar.Where(x => x.ID == AksesuarID).FirstOrDefault(); return(View(_aksesuarDuzenle)); } }
public ActionResult Kupon() { using (AdaGameContext context = new AdaGameContext()) { List <Kupon> kupon = context.Kupon.OrderBy(x => x.KuponAd).ToList(); return(View(kupon)); } }
public ActionResult KonsolDuzenle(int KonsolID) { using (AdaGameContext context = new AdaGameContext()) { var _konsolDuzenle = context.Konsol.Where(x => x.ID == KonsolID).FirstOrDefault(); return(View(_konsolDuzenle)); } }
public ActionResult Konsol() { using (AdaGameContext context = new AdaGameContext()) { var konsol = context.Konsol.ToList(); return(View(konsol)); } }
public ActionResult XBOneOyun() { ViewBag.Message = "XB ONE Oyun"; using (AdaGameContext context = new AdaGameContext()) { List <Urun> XBOneOyun = context.Urun.OrderBy(x => x.UrunAdi).ToList(); return(View(XBOneOyun)); } }
public ActionResult XBKonsol() { ViewBag.Message = "XB Konsol"; using (AdaGameContext context = new AdaGameContext()) { List <Konsol> XBKonsol = context.Konsol.OrderBy(x => x.KonsolAdi).ToList(); return(View(XBKonsol)); } }
public ActionResult Index() { using (AdaGameContext context = new AdaGameContext()) { AnaSayfaDTO anaSayfa = new AnaSayfaDTO(); anaSayfa.slider = context.Slider.Where(x => (x.BaslangicTarih <= DateTime.Now && x.BitisTarih > DateTime.Now)).ToList(); anaSayfa.yeniurunps4 = context.Urun.Where(x => x.Tip == 1).OrderByDescending(x => x.ID).Take(5).ToList(); anaSayfa.yeniurunxbox = context.Urun.Where(x => x.Tip == 2).OrderByDescending(x => x.ID).Take(5).ToList(); anaSayfa.yeniurunpc = context.Urun.Where(x => x.Tip == 3).OrderByDescending(x => x.ID).Take(5).ToList(); anaSayfa.fiyatagoreps4 = context.Urun.Where(x => x.Tip == 1).OrderByDescending(x => x.Fiyat).Take(8).ToList(); anaSayfa.fiyatagorexbox = context.Urun.Where(x => x.Tip == 2).OrderByDescending(x => x.Fiyat).Take(8).ToList(); anaSayfa.fiyatagorepc = context.Urun.Where(x => x.Tip == 3).OrderByDescending(x => x.Fiyat).Take(8).ToList(); return(View(anaSayfa)); } }
public ActionResult KonsolSil(int KonsolID) { try { using (AdaGameContext context = new AdaGameContext()) { context.Konsol.Remove(context.Konsol.First(d => d.ID == KonsolID)); context.SaveChanges(); return(RedirectToAction("Konsol", "Admin")); } } catch (Exception ex) { throw new Exception("Silerken hata oluştu", ex.InnerException); } }
public ActionResult Contact(Oneri iletisimform) { try { using (AdaGameContext context = new AdaGameContext()) { Oneri _iletisimform = new Oneri(); _iletisimform.AdSoyad = iletisimform.AdSoyad; _iletisimform.Telefon = iletisimform.Telefon; _iletisimform.Eposta = iletisimform.Eposta; _iletisimform.Mesaj = iletisimform.Mesaj; _iletisimform.Tarih = DateTime.Now; context.Oneri.Add(_iletisimform); context.SaveChanges(); TempData["Mesaj"] = "Form Başarıyla gönderilmiştir."; return(View()); } } catch (Exception ex) { throw new Exception("Eklerken hata oluştu"); } }