7.5.1.1 Adding the View Model; Listing 7-17 The Contents of the PagingInfo.cs File
This commit is contained in:
parent
af43a33a3a
commit
d7dcb89a64
19
SportsStore/SportsStore.WebUI/Models/PaingInfo.cs
Normal file
19
SportsStore/SportsStore.WebUI/Models/PaingInfo.cs
Normal 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); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user