Example #1
0
        public ActionResult CreateCommentSave(bgk_yorum comment)
        {
            string result;

            if (comment.Yorum == null || (Session["memberInfo"] == null && comment.Yazan == null))
            {
                result = "<font color=red>Boş bıraktığınız alan var..</font>";
            }
            else
            {
                comment.YazilmaTarihi = DateTime.Now;
                if (Session["memberID"].ToString() == "0")
                {
                    comment.Onay = false;
                    result       = "<font color=green>Yorumunuz başarıyla kaydedildi.. Onaylandıktan sonra yayınlanacak..</font><script typr=\"text/javascript\">setTimeout(function (){ ToggleCommentBar(); }, 2000);</script>";
                }
                else
                {
                    comment.Onay = BGKFunction.GetMyRole().YorumOnay;
                    var post = Db.bgk_yazi.Find(comment.YaziID);
                    result = "<font color=green>Yorumunuz başarıyla yayınlandı..</font><script typr=\"text/javascript\">setTimeout(function (){ window.location.href = '" + Url.Action("Details", new { id = comment.YaziID, seo = post.Seo }) + "'; }, 2000);</script>";
                }
                Db.bgk_yorum.Add(comment);
                Db.SaveChanges();
            }
            return(Content(result));
        }
Example #2
0
        public ActionResult Vote()
        {
            int id = Convert.ToInt32(Request.Form["id"]);

            if (!BGKFunction.GetMyRole().OyKullanma)
            {
                return(Content("Oy Kullanma yetkiniz yok :("));
            }
            else if (!BGKFunction.IsPostVoted(id))
            {
                bgk_oylama rating = new bgk_oylama();
                rating.Puan = Convert.ToInt32(Request.Form["point"]);
                if (Session["memberInfo"] != null)
                {
                    rating.UyeID = (int)Session["memberID"];
                }
                else
                {
                    rating.OylayanIP = BGKFunction.GetIPAddress();
                }
                rating.YaziID = id;
                Db.bgk_oylama.Add(rating);
                Db.SaveChanges();
                return(Content("Oy kullandığınız için teşekkür ederiz."));
            }
            else
            {
                return(Content("Daha önce oy kullandınız."));
            }
        }
Example #3
0
 public ActionResult Create()
 {
     if (!BGKFunction.GetMyRole().YaziYazma)
     {
         return(HttpNotFound());
     }
     ViewBag.KategoriID = new SelectList(Db.bgk_kategori.Where(x => x.Onay == true), "Id", "Adi");
     return(View());
 }
Example #4
0
 public ActionResult Create(bgk_yazi model)
 {
     if (ModelState.IsValid)
     {
         model.Seo         = model.Baslik.ConvertSeo();
         model.YazimTarihi = DateTime.Now;
         model.UyeID       = (int)Session["memberID"];
         model.Onay        = BGKFunction.GetMyRole().YaziOnay;
         model.Manset      = false;
         model.Okunma      = 0;
         Db.bgk_yazi.Add(model);
         Db.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     ViewBag.KategoriID = new SelectList(Db.bgk_kategori.Where(x => x.Onay == true), "Id", "Adi");
     return(View(model));
 }