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(); }
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"); }
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(); } }
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"); }
public void YorumEkle(Yorum yorum) { context.Yorumlar.Add(yorum); context.SaveChanges(); }