コード例 #1
0
        public JsonResult EditPromotionalPrice(int bookId, PromotionalPriceFormDto promotionalPriceFormDto)
        {
            if (ModelState.IsValid)
            {
                bookPilotageService.UpdatePromotionalPrice(promotionalPriceFormDto, bookId);

                var bookIndexDto = bookPilotageService.GetBookIndexDto(bookId);
                var html         = PartialView("views/pilotage/books/_Index_Book.cshtml", bookIndexDto).Render(this.HttpContext);
                var data         = new
                {
                    BookId = bookId,
                    Html   = html
                };

                return(Json(data));
            }

            return(GetPromotionalPriceFormBody(promotionalPriceFormDto));
        }
コード例 #2
0
        public JsonResult EditPromotionalPrice(int bookId, PromotionalPriceFormDto promotionalPriceFormDto)
        {
            if (ModelState.IsValid)
            {
                bookPilotageService.UpdatePromotionalPrice(promotionalPriceFormDto, bookId);

                var bookIndexDto = bookPilotageService.GetBookIndexDto(bookId);
                var html         = ViewRenderer.RenderPartialView("_Index_Book", bookIndexDto, this.ControllerContext);
                var data         = new
                {
                    BookId = bookId,
                    Html   = html
                };

                var jsonResponse = new JsonResponse(data);

                return(Json(jsonResponse, JsonRequestBehavior.AllowGet));
            }

            return(GetPromotionalPriceFormBody(promotionalPriceFormDto));
        }