Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Web/Views/OrderAdmin/Index.cshtml @ 12012

Last change on this file since 12012 was 9582, checked in by fschoepp, 12 years ago

#1888:

  • Added an overview for users to inspect their orders
  • Order Administrators may now suspend or reactivate orders
  • When creating an order, its necessary to enter payment information (paypal, credit card,...) before
  • Also, the billing period and type must be entered during the creation of an order.
File size: 3.4 KB
RevLine 
[9556]1@model HeuristicLab.Services.Optimization.Web.Models.OrderAdminModel
2
3@{
4    ViewBag.Title = "Order Administration";
5}
6
7<h2>Welcome to the order administartion!</h2>
8
[9582]9<h3>Newly created orders:</h3>
10@if (Model.CreatedOrders != null && Model.CreatedOrders.Count > 0) {
[9556]11
12<table>
13<thead>
14<tr>
15<th>Username:</th><th>Order details:</th><th>Activate order?</th>
16</tr>
17</thead>
18<tbody>
[9582]19@foreach (var order in Model.CreatedOrders) {
[9556]20    <tr>
21    <td>@order.User.Name</td>
22    <td>
23   
24   
25    <table>
26    <thead>
27    <tr>
28    <th>Id:</th>
29    <th>Product name:</th>
30    <th>Product price:</th>
31    <th>Product quantity:</th>
32    </tr>
33    </thead>
34    <tbody>
35    @foreach (var orderLine in order.OrderLines) {
36        <tr>
[9582]37        <td>@orderLine.OrderId</td>
[9556]38        <td>@orderLine.Product.Name</td>
39        <td>@orderLine.ProductPrice</td>
40        <td>@orderLine.Quantity</td>
41        </tr>
42    }
43    </tbody>
44    </table>
45    </td>
46    <td>
47    @using (Html.BeginForm("ActivateOrder", "OrderAdmin")) {
[9582]48        <input type="hidden" name="OrderId" value="@order.OrderId" />
[9556]49        <input type="submit" value="Activate" />
50    }
51    </td>
52    </tr>
53}
54</tbody>
55</table>
56}
57else {
[9582]58    <p>No new orders available.</p>
59}
60
61<h3>Active orders:</h3>
62@if (Model.ActiveOrders != null && Model.ActiveOrders.Count > 0) {
63
64<table>
65<thead>
66<tr>
67<th>Username:</th><th>Order details:</th><th>Suspend order?</th>
68</tr>
69</thead>
70<tbody>
71@foreach (var order in Model.ActiveOrders) {
72    <tr>
73    <td>@order.User.Name</td>
74    <td>
75   
76   
77    <table>
78    <thead>
79    <tr>
80    <th>Id:</th>
81    <th>Product name:</th>
82    <th>Product price:</th>
83    <th>Product quantity:</th>
84    </tr>
85    </thead>
86    <tbody>
87    @foreach (var orderLine in order.OrderLines) {
88        <tr>
89        <td>@orderLine.OrderId</td>
90        <td>@orderLine.Product.Name</td>
91        <td>@orderLine.ProductPrice</td>
92        <td>@orderLine.Quantity</td>
93        </tr>
94    }
95    </tbody>
96    </table>
97    </td>
98    <td>
99    @using (Html.BeginForm("SuspendOrder", "OrderAdmin")) {
100        <input type="hidden" name="OrderId" value="@order.OrderId" />
101        <input type="submit" value="Suspend" />
102    }
103    </td>
104    </tr>
105}
106</tbody>
107</table>
108}
109else {
110    <p>No activated orders available.</p>
111}
112
113<h3>Suspended orders:</h3>
114@if (Model.SuspendedOrders != null && Model.SuspendedOrders.Count > 0) {
115
116<table>
117<thead>
118<tr>
119<th>Username:</th><th>Order details:</th><th>Activate order?</th>
120</tr>
121</thead>
122<tbody>
123@foreach (var order in Model.SuspendedOrders) {
124    <tr>
125    <td>@order.User.Name</td>
126    <td>
127   
128   
129    <table>
130    <thead>
131    <tr>
132    <th>Id:</th>
133    <th>Product name:</th>
134    <th>Product price:</th>
135    <th>Product quantity:</th>
136    </tr>
137    </thead>
138    <tbody>
139    @foreach (var orderLine in order.OrderLines) {
140        <tr>
141        <td>@orderLine.OrderId</td>
142        <td>@orderLine.Product.Name</td>
143        <td>@orderLine.ProductPrice</td>
144        <td>@orderLine.Quantity</td>
145        </tr>
146    }
147    </tbody>
148    </table>
149    </td>
150    <td>
151    @using (Html.BeginForm("ReactivateOrder", "OrderAdmin")) {
152        <input type="hidden" name="OrderId" value="@order.OrderId" />
153        <input type="submit" value="Reactivate" />
154    }
155    </td>
156    </tr>
157}
158</tbody>
159</table>
160}
161else {
162    <p>No suspended orders available.</p>
[9556]163}
Note: See TracBrowser for help on using the repository browser.