Browse Source

Update part-II create book.

pull/1194/head
Halil İbrahim Kalkan 7 years ago
parent
commit
2fdb0f56f8
  1. 15
      docs/en/Tutorials/AspNetCore-Mvc/Part-I.md
  2. 12
      docs/en/Tutorials/AspNetCore-Mvc/Part-II.md
  3. BIN
      docs/en/Tutorials/AspNetCore-Mvc/images/bookstore-index-js-file-v2.png
  4. BIN
      docs/en/Tutorials/AspNetCore-Mvc/images/bookstore-index-js-file.png

15
docs/en/Tutorials/AspNetCore-Mvc/Part-I.md

@ -64,7 +64,7 @@ Define the `BookType` enum in the `Acme.BookStore.Domain.Shared` project:
````C#
namespace Acme.BookStore
{
public enum BookType : byte
public enum BookType
{
Undefined,
Adventure,
@ -336,8 +336,8 @@ Open the `Index.cshtml` and change the content as shown below:
````html
@page
@using Acme.BookStore.Pages.Books
@inherits Acme.BookStore.Pages.BookStorePageBase
@using Acme.BookStore.Web.Pages.Books
@inherits Acme.BookStore.Web.Pages.BookStorePageBase
@model IndexModel
<h2>Books</h2>
@ -388,15 +388,14 @@ When you click to the Books menu item, you are redirected to the new Books page.
We will use the [Datatables.net](https://datatables.net/) JQuery plugin to show list of tables on the page. Datatables can completely work via AJAX, it is fast and provides a good user experience. Datatables plugin is configured in the startup template, so you can directly use it in any page without including any style or script file to your page.
##### Index.cshtml Changes
##### Index.cshtml
Change the `Pages/Books/Index.cshtml` as following:
````html
@page
@using Acme.BookStore.Pages.Books
@inherits Acme.BookStore.Pages.BookStorePageBase
@model IndexModel
@inherits Acme.BookStore.Web.Pages.BookStorePageBase
@model Acme.BookStore.Web.Pages.Books.IndexModel
@section scripts
{
<abp-script src="/Pages/Books/index.js" />
@ -429,7 +428,7 @@ Change the `Pages/Books/Index.cshtml` as following:
Create `index.js` JavaScript file under the `Pages/Books/` folder:
![bookstore-index-js-file](images/bookstore-index-js-file.png)
![bookstore-index-js-file](images/bookstore-index-js-file-v2.png)
`index.js` content is shown below:

12
docs/en/Tutorials/AspNetCore-Mvc/Part-II.md

@ -2,13 +2,13 @@
### About this Tutorial
This is the second part of the tutorial series. See all parts:
This is the second part of the ASP.NET Core MVC tutorial series. See all parts:
* [Part I: Create the project and a book list page](Part-I.md)
* **Part II: Create, Update and Delete books (this tutorial)**
* [Part III: Integration Tests](Part-III.md)
You can download the **source code** of the application [from here](https://github.com/volosoft/abp/tree/master/samples/BookStore).
You can access to the **source code** of the application from [the GitHub repository](https://github.com/volosoft/abp/tree/master/samples/BookStore).
### Creating a New Book
@ -30,7 +30,7 @@ Open the `CreateModal.cshtml.cs` file (`CreateModalModel` class) and replace wit
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Acme.BookStore.Pages.Books
namespace Acme.BookStore.Web.Pages.Books
{
public class CreateModalModel : BookStorePageModelBase
{
@ -63,9 +63,9 @@ Open the `CreateModal.cshtml` file and paste the code below:
````html
@page
@inherits Acme.BookStore.Pages.BookStorePageBase
@inherits Acme.BookStore.Web.Pages.BookStorePageBase
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@model Acme.BookStore.Pages.Books.CreateModalModel
@model Acme.BookStore.Web.Pages.Books.CreateModalModel
@{
Layout = null;
}
@ -83,7 +83,7 @@ Open the `CreateModal.cshtml` file and paste the code below:
* This modal uses `abp-dynamic-form` tag helper to automatically create the form from the `CreateBookViewModel` class.
* `abp-model` attribute indicates the model object, the `Book` property in this case.
* `data-ajaxForm` attribute makes the form submitting via AJAX, instead of a classic page post.
* `abp-form-content` tag helper is a placeholder to render the form controls (this is optional and needed only if you added some other content in the `abp-dynamic-form` tag, just like in this view).
* `abp-form-content` tag helper is a placeholder to render the form controls (this is optional and needed only if you added some other content in the `abp-dynamic-form` tag, just like in this page).
#### Add the "New book" Button

BIN
docs/en/Tutorials/AspNetCore-Mvc/images/bookstore-index-js-file-v2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
docs/en/Tutorials/AspNetCore-Mvc/images/bookstore-index-js-file.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Loading…
Cancel
Save