Ejemplo n.º 1
0
        public ActionResult KoseYazisiEkle(KoseYazisiModel model)
        {
            try
            {
                Haber haber = Mapper.Map <KoseYazisiModel, Haber>(model);

                haber.DegistirmeKullaniciId = AktifKullanici.Id;
                haber.OlusturmaKullaniciId  = AktifKullanici.Id;
                haber.YayinlamaKullaniciId  = AktifKullanici.Id;
                haber.DegistirmeTarihi      = DateTime.Now;
                haber.OlusturmaTarihi       = DateTime.Now;
                haber.YayinlanmaTarihi      = DateTime.Now;
                haber.OkunmaSayisi          = 0;
                haber.YorumSayisi           = 0;
                haber.HaberTipId            = 2;
                haber.SeoBaslik             = StringIslemleri.ToSeoUrl(model.Baslik);

                haberServis.Ekle(haber);

                return(RedirectToAction("KoseYazilari"));
            }
            catch (Exception ex)
            {
                model.Kategoriler = kategoriServis.Kategoriler();
                model.Yazarlar    = kullaniciServis.RolKullanicilar("Yazar");
            }

            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult KoseYazisiDuzenle(KoseYazisiModel model)
        {
            try
            {
                var haber = haberServis.Bul(model.Id);

                haber.Baslik                = model.Baslik;
                haber.Icerik                = model.Icerik;
                haber.KategoriId            = model.KategoriId;
                haber.Yayinda               = model.Yayinda;
                haber.YazarId               = model.YazarId;
                haber.DegistirmeKullaniciId = AktifKullanici.Id;
                haber.DegistirmeTarihi      = DateTime.Now;
                haber.SeoBaslik             = StringIslemleri.ToSeoUrl(model.Baslik);

                haberServis.Guncelle(haber);

                return(RedirectToAction("KoseYazilari"));
            }
            catch (Exception ex)
            {
                model.Kategoriler = kategoriServis.Kategoriler();
                model.Yazarlar    = kullaniciServis.RolKullanicilar("Yazar");
            }

            return(View(model));
        }
Ejemplo n.º 3
0
        public ActionResult KoseYazisiDuzenle(int id)
        {
            Haber           haber = haberServis.Bul(id);
            KoseYazisiModel model = Mapper.Map <Haber, KoseYazisiModel>(haber);

            model.Kategoriler = kategoriServis.Kategoriler();
            model.Yazarlar    = kullaniciServis.RolKullanicilar("Yazar");

            return(View(model));
        }
Ejemplo n.º 4
0
        public ActionResult KoseYazisiEkle()
        {
            KoseYazisiModel model = new KoseYazisiModel
            {
                Kategoriler = kategoriServis.Kategoriler(),
                Yazarlar    = kullaniciServis.RolKullanicilar("Yazar"),
                Yayinda     = true
            };

            return(View(model));
        }