1: <%@ Control Language="C#"
2: Inherits="System.Web.Mvc.ViewUserControl<MVC.MyUtility.PagedView<WebSellingMVC.Models.Product>>" %>
3:
4: <div id="sortContainer">
5: <table width="100%">
6: <tr>
7: <td colspan="10">
8: <% if (Model.IsFastNavPrevAvailable)
9: {%>
10: <%= Ajax.ActionLink("<< ", "MovePrevFast", new { pageIndex = Model.PageIndex, propertyToSort = Model.SortedProperty, sortType = Model.IsSortTypeAscending }, new AjaxOptions()
11: {
12: UpdateTargetId = "sortContainer",
13: InsertionMode = InsertionMode.Replace
14: })%>
15: <% }%>
16: <% foreach (int item in Model.PageList)
17: { %>
18: <%= Ajax.ActionLink(item.ToString() + " ", "MovePage", new { pageIndex = item, propertyToSort = Model.SortedProperty, sortType = Model.IsSortTypeAscending }, new AjaxOptions()
19: {
20: UpdateTargetId = "sortContainer",
21: InsertionMode = InsertionMode.Replace
22: })%>
23: <% }%>
24: <% if (Model.IsFastNavNextAvailable)
25: {%>
26: <%= Ajax.ActionLink(">> ", "MoveNextFast", new { pageIndex = Model.PageIndex, propertyToSort = Model.SortedProperty, sortType = Model.IsSortTypeAscending }, new AjaxOptions()
27: {
28: UpdateTargetId = "sortContainer",
29: InsertionMode = InsertionMode.Replace
30: })%>
31: <% }%>
32: </td>
33: </tr>
34: <tr>
35: <th>
36: <%= Ajax.ActionLink("CodProduct", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "CodProduct", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
37: {
38: UpdateTargetId = "sortContainer",
39: InsertionMode = InsertionMode.Replace
40: })%>
41: </th>
42: <th>
43: <%= Ajax.ActionLink("NameIT", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "NameIT", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
44: {
45: UpdateTargetId = "sortContainer",
46: InsertionMode = InsertionMode.Replace
47: })%>
48: </th>
49: <th>
50: <%= Ajax.ActionLink("NameEN", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "NameEN", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
51: {
52: UpdateTargetId = "sortContainer",
53: InsertionMode = InsertionMode.Replace
54: })%>
55: </th>
56: <th>
57: <%= Ajax.ActionLink("CategoryIT", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "CategoryIT", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
58: {
59: UpdateTargetId = "sortContainer",
60: InsertionMode = InsertionMode.Replace
61: })%>
62: </th>
63: <th>
64: <%= Ajax.ActionLink("CategoryEN", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "CategoryEN", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
65: {
66: UpdateTargetId = "sortContainer",
67: InsertionMode = InsertionMode.Replace
68: })%>
69: </th>
70: <th>
71: <%= Ajax.ActionLink("TeamLine", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "TeamLine", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
72: {
73: UpdateTargetId = "sortContainer",
74: InsertionMode = InsertionMode.Replace
75: })%>
76: </th>
77: <th>
78: <%= Ajax.ActionLink("Brand", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "Brand", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
79: {
80: UpdateTargetId = "sortContainer",
81: InsertionMode = InsertionMode.Replace
82: })%>
83: </th>
84: <th>
85: <%= Ajax.ActionLink("UM", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "UM", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
86: {
87: UpdateTargetId = "sortContainer",
88: InsertionMode = InsertionMode.Replace
89: })%>
90: </th>
91: <th>
92: <%= Ajax.ActionLink("Quantity", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "Quantity", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
93: {
94: UpdateTargetId = "sortContainer",
95: InsertionMode = InsertionMode.Replace
96: })%>
97: </th>
98: <th>
99: <%= Ajax.ActionLink("Price", "Sort", new { pageIndex = Model.PageIndex, propertyToSort = "Price", sortType = !Model.IsSortTypeAscending }, new AjaxOptions()
100: {
101: UpdateTargetId = "sortContainer",
102: InsertionMode = InsertionMode.Replace
103: })%>
104: </th>
105: </tr>
106: <% foreach (var item in Model.ObjectList)
107: {%>
108: <tr>
109: <td>
110: <%= Html.Encode(item.CodProduct) %>
111: </td>
112: <td>
113: <%= Html.Encode(item.NameIT) %>
114: </td>
115: <td>
116: <%= Html.Encode(item.NameEN) %>
117: </td>
118: <td>
119: <%= Html.Encode(item.CategoryIT) %>
120: </td>
121: <td>
122: <%= Html.Encode(item.CategoryEN) %>
123: </td>
124: <td>
125: <%= Html.Encode(item.TeamLine) %>
126: </td>
127: <td>
128: <%= Html.Encode(item.Brand) %>
129: </td>
130: <td>
131: <%= Html.Encode(item.UM) %>
132: </td>
133: <td>
134: <%= Html.Encode(item.Quantity) %>
135: </td>
136: <td>
137: <%= Html.Encode(String.Format("{0:F}", item.Price)) %>
138: </td>
139: </tr>
140: <% }%>
141: <tr>
142: <td colspan="8">
143: Page
144: <%= Html.Encode(Model.PageIndex) %>
145: of
146: <%= Html.Encode(Model.PageCount) %>
147: </td>
148: <td colspan="2" align="right">
149: <%if (Model.IsPrevAvailable)
150: { %>
151: <%= Ajax.ActionLink("Prev", "MovePage", new { pageIndex = Model.PageIndex - 1, propertyToSort = Model.SortedProperty, sortType = Model.IsSortTypeAscending }, new AjaxOptions()
152: {
153: UpdateTargetId = "sortContainer",
154: InsertionMode = InsertionMode.Replace
155: })%>
156: <% }%>
157: <%if (Model.IsNextAvailable)
158: { %>
159: <%= Ajax.ActionLink("Next", "MovePage", new { pageIndex = Model.PageIndex + 1, propertyToSort = Model.SortedProperty, sortType = Model.IsSortTypeAscending }, new AjaxOptions()
160: {
161: UpdateTargetId = "sortContainer",
162: InsertionMode = InsertionMode.Replace
163: })%>
164: <% }%>
165: </td>
166: </tr>
167: </table>
168: </div>