Exemplo n.º 1
0
 public void HabereYorumEkle(HaberCl haber,Yorum yorum)
 {
     haber.Yorumlar.Add(yorum);
     var h = HaberGetir(haber.HaberID);
     h.Yorumlar = haber.Yorumlar;
     context.Entry(h).State = System.Data.Entity.EntityState.Modified;
     context.SaveChanges();
 }
Exemplo n.º 2
0
 public ActionResult HaberDetay(string txtYorum, int id, string txtName)
 {
     if (txtName == null)
     {
         txtName = "Misafir";
     }
     HaberCl haber = haberhelper.HaberGetir(id);
     Yorum yorum = new Yorum();
     yorum.YorumDurumu = false;
     if (User.IsInRole("SuperAdmin"))
     {
         yorum.YorumDurumu = true;
     }
     yorum.YorumIcerik = txtYorum;
     yorum.YorumYazari = txtName;
     yorum.YorumYazmaTarihi = DateTime.Now;
     haberhelper.HabereYorumEkle(haber, yorum);
     return RedirectToAction("HaberDetay");
 }
Exemplo n.º 3
0
 public ActionResult YorumEkle(Yorum yorum, int HaberID)
 {
     yorum.YorumYazari = User.Identity.Name;
     ViewBag.haberlistesi = haberhelper.TumHaberleriListele();
     yorum.YorumIcerik = WebUtility.HtmlDecode(yorum.YorumIcerik);
     yorum.YorumYazmaTarihi = DateTime.Now;
     yorum.YorumHaberi = haberhelper.HaberGetir(HaberID);
     try
     {
         yorumhelper.YorumEkle(yorum);
         return RedirectToAction("YorumListele");
     }
     catch (Exception)
     {
         return View();
     }
 }
Exemplo n.º 4
0
        public ActionResult YorumDuzenleme(Yorum yorum, int yorumID)
        {
            yorum.YorumIcerik = WebUtility.HtmlDecode(yorum.YorumIcerik);
            var y = yorumhelper.YorumGetir(yorum.YorumID);

            y.YorumIcerik = yorum.YorumIcerik;
            y.YorumDurumu = yorum.YorumDurumu;

            context.Entry(y).State = System.Data.Entity.EntityState.Modified;
            context.SaveChanges();

            return RedirectToAction("YorumDuzenle");
        }
Exemplo n.º 5
0
 public void YorumEkle(Yorum yorum)
 {
     context.Yorumlar.Add(yorum);
     context.SaveChanges();
 }