7.5.1.1 Adding the View Model; Listing 7-17 The Contents of the PagingInfo.cs File

This commit is contained in:
Jason Zhu 2021-09-08 15:09:02 +10:00
parent af43a33a3a
commit d7dcb89a64
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SportsStore.WebUI.Models
{
public class PaingInfo
{
public int TotalItems { get; set; }
public int ItemsPerPage { get; set; }
public int CurrentPage { get; set; }
public int TotalPages
{
get { return (int)Math.Ceiling((decimal)TotalItems / ItemsPerPage); }
}
}
}

View File

@ -122,6 +122,7 @@
<DependentUpon>Global.asax</DependentUpon> <DependentUpon>Global.asax</DependentUpon>
</Compile> </Compile>
<Compile Include="Infrastructure\NinjectDependencyResolver.cs" /> <Compile Include="Infrastructure\NinjectDependencyResolver.cs" />
<Compile Include="Models\PaingInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -139,7 +140,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="App_Data\" /> <Folder Include="App_Data\" />
<Folder Include="Models\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SportsStore.Domain\SportsStore.Domain.csproj"> <ProjectReference Include="..\SportsStore.Domain\SportsStore.Domain.csproj">