예제 #1
0
        // GET: Admin/Yorum
        public ActionResult Index(int?id)
        {
            if (id != null)
            {
                Urun urun = um.Find(x => x.ID == id);

                return(View(urun.Yorumlar));
            }
            return(View(ym.List()));
        }
예제 #2
0
        // GET: Admin/Urun/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Urun urun = u.Find(x => x.ID == id);

            if (urun == null)
            {
                return(HttpNotFound());
            }
            return(View(urun));
        }
예제 #3
0
        public ActionResult Create(Comment comment, int?noteid)
        {
            ModelState.Remove("CreatedOn");
            ModelState.Remove("ModifiedOn");
            ModelState.Remove("ModifiedUsername");

            if (ModelState.IsValid)
            {
                if (noteid == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }

                Urun urun = urunManager.Find(x => x.ID == noteid);

                if (urun == null)
                {
                    return(new HttpNotFoundResult());
                }

                comment.Urun  = urun;
                comment.Owner = CurrentSession.User;

                if (commentManager.Insert(comment) > 0)
                {
                    return(Json(new { result = true }, JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(new { result = false }, JsonRequestBehavior.AllowGet));
        }
예제 #4
0
        // GET: Comment
        public ActionResult ShowNoteComments(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            //Note note = noteManager.Find(x => x.Id == id);
            Urun urun = um.Find(x => x.ID == id);

            if (urun == null)
            {
                return(HttpNotFound());
            }

            return(PartialView("_PartialComment", urun.Yorumlar));
        }
예제 #5
0
        public ActionResult sepeteEkle(int?id)
        {
            Urun urun = um.Find(x => x.ID == id);

            if (HttpContext.Session["sepet"] == null)
            {
                HttpContext.Session["sepet"] = new List <sepetItem>();
                cart.AddProducts(urun, 1);
            }
            else
            {
                cart.products = HttpContext.Session["sepet"] as List <sepetItem>;
                cart.AddProducts(urun, 1);
            }

            var sepettekiler = HttpContext.Session["sepet"] as List <sepetItem>;

            return(View("Index", sepettekiler));
        }
예제 #6
0
 public ActionResult UrunDetayi(int id)
 {
     return(View(um.Find(x => x.ID == id)));
 }