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)); }
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)); }