Пример #1
0
        public async Task <ActionResult> ProductDetail(int id)
        {
            DBModelContainer db = new DBModelContainer();
            ProductionDetail pr = new ProductionDetail();

            pr.ProductId = id;

            // get product title equal to CategoryName + " > " + names.ProductName;
            ProductionService service = new ProductionService();

            pr.Title = (await service.getProductTitleByProductId(id)).Title;

            /*{
             *  Color,
             *  Description,
             *  Price,
             *  Size,
             *  Amount,
             *  Picture,
             *  ProductDetailsId,
             *  ProductId,
             *  ProductionName
             * }*/
            // get all productDetails by a given product
            pr.listdata = await service.getProductDetailsByProductId(id);

            /*{
             *  ProductId,
             *
             *  Title,
             *  Content,
             *  OverallRating,
             *
             *  ReviewId,
             *  UserId,
             *  UserName,
             *  ReviewDate
             * }*/
            // get all reviews about a given product
            pr.reviewListData = await service.getReviewsByProductId(id);

            return(View(pr));
        }