7.5.1.1 Adding the View Model; e.g. 716 The PagingInfo View Model Class
This commit is contained in:
parent
0c548df719
commit
103a66938d
19
SportsStore/SportsStore.WebUI/Models/PagingInfo.cs
Normal file
19
SportsStore/SportsStore.WebUI/Models/PagingInfo.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 PagingInfo
|
||||||
|
{
|
||||||
|
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); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -165,6 +165,7 @@
|
|||||||
<DependentUpon>Global.asax</DependentUpon>
|
<DependentUpon>Global.asax</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Infrastructure\NinjectControllerFactory.cs" />
|
<Compile Include="Infrastructure\NinjectControllerFactory.cs" />
|
||||||
|
<Compile Include="Models\PagingInfo.cs" />
|
||||||
<Compile Include="Product.cs">
|
<Compile Include="Product.cs">
|
||||||
<DependentUpon>EFDbContext.tt</DependentUpon>
|
<DependentUpon>EFDbContext.tt</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -227,7 +228,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="App_Data\" />
|
<Folder Include="App_Data\" />
|
||||||
<Folder Include="Models\" />
|
|
||||||
<Folder Include="Views\Productr\" />
|
<Folder Include="Views\Productr\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user