示例#1
0
        public ActionResult Index(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var product = db.Products.Find(id);

            if (product == null)
            {
                return(HttpNotFound());
            }
            else
            {
                ViewBag.Product  = db.Products.Find(id);
                ViewBag.Image    = productDetail.geAllImagesOfProduct(id).Take(4);
                ViewBag.Feedback = feedback.geAllFeedbackOfProduct(id);
            }

            return(View());
        }