Beispiel #1
0
 public ActionResult SlideDuzenle(Slider slide, HttpPostedFileBase file)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             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);
     }
 }
Beispiel #2
0
 public ActionResult EtkinlikDuzenle(Duyuru d, HttpPostedFileBase file)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             var _etkinlikDuzenle = context.Duyuru.Where(x => x.ID == d.ID).FirstOrDefault();
             if (file != null && file.ContentLength > 0)
             {
                 MemoryStream memoryStream = file.InputStream as MemoryStream;
                 if (memoryStream == null)
                 {
                     memoryStream = new MemoryStream();
                     file.InputStream.CopyTo(memoryStream);
                 }
                 _etkinlikDuzenle.DuyuruFoto = memoryStream.ToArray();
             }
             _etkinlikDuzenle.DuyuruBaslik = d.DuyuruBaslik;
             _etkinlikDuzenle.DuyuruIcerik = d.DuyuruIcerik;
             _etkinlikDuzenle.Tarih        = DateTime.Now;
             context.SaveChanges();
             return(RedirectToAction("Etkinlikler", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Güncellerken hata oluştu " + ex.Message);
     }
 }
Beispiel #3
0
 public ActionResult OyunEkle(Takim t, HttpPostedFileBase file)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             Takim _Oyun = new Takim();
             if (file != null && file.ContentLength > 0)
             {
                 MemoryStream memoryStream = file.InputStream as MemoryStream;
                 if (memoryStream == null)
                 {
                     memoryStream = new MemoryStream();
                     file.InputStream.CopyTo(memoryStream);
                 }
                 _Oyun.Foto = memoryStream.ToArray();
             }
             _Oyun.AdSoyad = t.AdSoyad;
             _Oyun.Icerik  = t.Icerik;
             _Oyun.Tip     = t.Tip;
             context.Takim.Add(_Oyun);
             context.SaveChanges();
             return(RedirectToAction("Oyun", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Eklerken hata oluştu");
     }
 }
Beispiel #4
0
 public ActionResult IstekEkle(Blog b, HttpPostedFileBase file)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             Blog Istek = new Blog();
             if (file != null && file.ContentLength > 0)
             {
                 MemoryStream memoryStream = file.InputStream as MemoryStream;
                 if (memoryStream == null)
                 {
                     memoryStream = new MemoryStream();
                     file.InputStream.CopyTo(memoryStream);
                 }
                 Istek.BlogFoto = memoryStream.ToArray();
             }
             Istek.BlogBaslik = b.BlogBaslik;
             Istek.BlogIcerik = b.BlogIcerik;
             Istek.Tarih      = DateTime.Now;
             context.Blog.Add(Istek);
             context.SaveChanges();
             return(RedirectToAction("Istek", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Eklerken hata oluştu");
     }
 }
Beispiel #5
0
 public ActionResult SlideEkle(Slider s, HttpPostedFileBase file)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             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");
     }
 }
Beispiel #6
0
 public ActionResult OyunDuzenle(Takim t, HttpPostedFileBase file)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             var _OyunDuzenle = context.Takim.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);
                 }
                 _OyunDuzenle.Foto = memoryStream.ToArray();
             }
             _OyunDuzenle.AdSoyad = t.AdSoyad;
             _OyunDuzenle.Icerik  = t.Icerik;
             _OyunDuzenle.Tip     = t.Tip;
             context.SaveChanges();
             return(RedirectToAction("Oyun", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Güncellerken hata oluştu " + ex.Message);
     }
 }
Beispiel #7
0
 public ActionResult EtkinlikEkle(Duyuru d, HttpPostedFileBase file)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             Duyuru _duyuru = new Duyuru();
             if (file != null && file.ContentLength > 0)
             {
                 MemoryStream memoryStream = file.InputStream as MemoryStream;
                 if (memoryStream == null)
                 {
                     memoryStream = new MemoryStream();
                     file.InputStream.CopyTo(memoryStream);
                 }
                 _duyuru.DuyuruFoto = memoryStream.ToArray();
             }
             _duyuru.DuyuruBaslik = d.DuyuruBaslik;
             _duyuru.DuyuruIcerik = d.DuyuruIcerik;
             _duyuru.Tarih        = DateTime.Now;
             context.Duyuru.Add(_duyuru);
             context.SaveChanges();
             return(RedirectToAction("Etkinlikler", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Eklerken hata oluştu");
     }
 }
Beispiel #8
0
 public ActionResult HaberEkle(Modul m, HttpPostedFileBase file)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             Modul _Haber = new Modul();
             if (file != null && file.ContentLength > 0)
             {
                 MemoryStream memoryStream = file.InputStream as MemoryStream;
                 if (memoryStream == null)
                 {
                     memoryStream = new MemoryStream();
                     file.InputStream.CopyTo(memoryStream);
                 }
                 _Haber.ModulFoto = memoryStream.ToArray();
             }
             _Haber.ModulBaslik = m.ModulBaslik;
             _Haber.ModulIcerik = m.ModulIcerik;
             _Haber.Tarih       = DateTime.Now;
             context.Modul.Add(_Haber);
             context.SaveChanges();
             return(RedirectToAction("Haberler", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Eklerken hata oluştu");
     }
 }
Beispiel #9
0
 public ActionResult HaberDuzenle(int ModulID)
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var _HaberDuzenle = context.Modul.Where(x => x.ID == ModulID).FirstOrDefault();
         return(View(_HaberDuzenle));
     }
 }
Beispiel #10
0
 public ActionResult Haberler()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var Haberler = context.Modul.ToList();
         return(View(Haberler));
     }
 }
Beispiel #11
0
 public ActionResult Istekler()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         List <Blog> istekler = context.Blog.OrderByDescending(x => x.BlogTarih).ToList();
         return(View(istekler));
     }
 }
Beispiel #12
0
 public ActionResult SlideDuzenle(int SlideID)
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var _slideDuzenle = context.Slider.Where(x => x.ID == SlideID).FirstOrDefault();
         return(View(_slideDuzenle));
     }
 }
Beispiel #13
0
 public ActionResult Events()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         List <Duyuru> Etkinlik = context.Duyuru.OrderBy(x => x.Tarih).ToList();
         return(View(Etkinlik));
     }
 }
Beispiel #14
0
 public ActionResult EtkinlikDuzenle(int DuyuruID)
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var _EtkinlikDuzenle = context.Duyuru.Where(x => x.ID == DuyuruID).FirstOrDefault();
         return(View(_EtkinlikDuzenle));
     }
 }
Beispiel #15
0
 public ActionResult IstekDuzenle(int BlogID)
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var _IstekDuzenle = context.Blog.Where(x => x.ID == BlogID).FirstOrDefault();
         return(View(_IstekDuzenle));
     }
 }
Beispiel #16
0
 public ActionResult Slider()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var slider = context.Slider.ToList();
         return(View(slider));
     }
 }
Beispiel #17
0
 public ActionResult Istek()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var Istek = context.Blog.ToList();
         return(View(Istek));
     }
 }
Beispiel #18
0
 public ActionResult OneriDetay(int OneriID)
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var _OneriDuzenle = context.Oneri.FirstOrDefault(x => x.ID == OneriID);
         return(View(_OneriDuzenle));
     }
 }
Beispiel #19
0
 public ActionResult LolRehber()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         List <Takim> LolRehber = context.Takim.OrderByDescending(x => x.ID).ToList();
         return(View(LolRehber));
     }
 }
Beispiel #20
0
 public ActionResult EventDetails(int EtkinlikID)
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         Duyuru EventDetay = context.Duyuru.FirstOrDefault(x => x.ID == EtkinlikID);
         return(View(EventDetay));
     }
 }
Beispiel #21
0
 public ActionResult Etkinlikler()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var Etkinlikler = context.Duyuru.ToList();
         return(View(Etkinlikler));
     }
 }
Beispiel #22
0
 public ActionResult OyunDuzenle(int OyunID)
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var _OyunDuzenle = context.Takim.Where(x => x.ID == OyunID).FirstOrDefault();
         return(View(_OyunDuzenle));
     }
 }
Beispiel #23
0
 public ActionResult Oyun()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var Oyun = context.Takim.ToList();
         return(View(Oyun));
     }
 }
Beispiel #24
0
 public ActionResult Haberler()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         List <Modul> Haberler = context.Modul.OrderByDescending(x => x.Tarih).ToList();
         return(View(Haberler));
     }
 }
Beispiel #25
0
 public ActionResult MesajDetay(int OneriID)
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         Oneri MesajDetay = context.Oneri.FirstOrDefault(x => x.ID == OneriID);
         return(View(MesajDetay));
     }
 }
Beispiel #26
0
 public ActionResult DnVideo()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         List <Takim> DnVideo = context.Takim.OrderByDescending(x => x.ID).ToList();
         return(View(DnVideo));
     }
 }
Beispiel #27
0
 public ActionResult Mesajlarım()
 {
     using (MetaGameContext context = new MetaGameContext())
     {
         var Oneri = context.Oneri.ToList();
         return(View(Oneri));
     }
 }
Beispiel #28
0
        public ActionResult Index()
        {
            using (MetaGameContext context = new MetaGameContext())
            {
                AnaSayfaDTO anaSayfa = new AnaSayfaDTO();
                anaSayfa.slider = context.Slider.Where(x => (x.BaslangicTarih <= DateTime.Now && x.BitisTarih > DateTime.Now)).ToList();
                anaSayfa.Duyuru = context.Duyuru.OrderByDescending(x => x.DuyuruTarih).Take(3).ToList();
                anaSayfa.modul  = context.Modul.OrderByDescending(x => x.Tarih).Take(3).ToList();
                anaSayfa.takim  = context.Takim.OrderByDescending(x => x.ID).Take(3).ToList();

                return(View(anaSayfa));
            }
        }
Beispiel #29
0
 public ActionResult HaberSil(int ModulID)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             context.Modul.Remove(context.Modul.First(d => d.ID == ModulID));
             context.SaveChanges();
             return(RedirectToAction("Haberler", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Silerken hata oluştu", ex.InnerException);
     }
 }
Beispiel #30
0
 public ActionResult EtkinlikSil(int DuyuruID)
 {
     try
     {
         using (MetaGameContext context = new MetaGameContext())
         {
             context.Duyuru.Remove(context.Duyuru.First(d => d.ID == DuyuruID));
             context.SaveChanges();
             return(RedirectToAction("Etkinlikler", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Silerken hata oluştu", ex.InnerException);
     }
 }