// 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())); }
// 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)); }
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)); }
// 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)); }
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)); }
public ActionResult UrunDetayi(int id) { return(View(um.Find(x => x.ID == id))); }