Skip to content

Commit d5ef3f0

Browse files
committed
All customer views
1 parent 6ed7ba7 commit d5ef3f0

13 files changed

+60
-42
lines changed

.vs/BookShopInventoryApp/v14/.suo

0 Bytes
Binary file not shown.

BookShopInventoryApp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@
342342
<Content Include="Views\Customer\Index.cshtml" />
343343
<Content Include="Views\Customer\Create.cshtml" />
344344
<Content Include="Views\Customer\Details.cshtml" />
345+
<Content Include="Views\Customer\Delete.cshtml" />
345346
<Content Include="Views\Customer\Edit.cshtml" />
346347
</ItemGroup>
347348
<ItemGroup>

Models/OrderModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel.DataAnnotations;
34
using System.Linq;
45
using System.Web;
56
//using System.
@@ -8,6 +9,7 @@ namespace BookShopInventoryApp.Models
89
{
910
public class OrderModel
1011
{
12+
[Key]
1113
public int OrderNo { get; set; }
1214
public int Quantity { get; set; }
1315
public DateTime OrderDate { get; set; }

Views/Customer/Delete.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model BookShopInventoryApp.Models.CustomerModel
22

33
@{
4-
ViewBag.Title = "Delete";
4+
ViewBag.Title = "Delete Customer";
55
}
66

77
<h2>Delete</h2>

Views/Customer/Details.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model BookShopInventoryApp.Models.CustomerModel
22

33
@{
4-
ViewBag.Title = "Details";
4+
ViewBag.Title = "Customer Details";
55
}
66

77
<h2>Details</h2>

Views/Customer/Edit.cshtml

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,61 @@
11
@model BookShopInventoryApp.Models.CustomerModel
22

33
@{
4-
ViewBag.Title = "Edit";
4+
ViewBag.Title = "Edit Customer";
55
}
66

77
<h2>Edit</h2>
88

9-
<h3>Are you sure you want to delete this?</h3>
10-
<fieldset>
11-
<legend>CustomerModel</legend>
12-
13-
<div class="display-label">
14-
@Html.DisplayNameFor(model => model.FirstName)
15-
</div>
16-
<div class="display-field">
17-
@Html.DisplayFor(model => model.FirstName)
18-
</div>
19-
20-
<div class="display-label">
21-
@Html.DisplayNameFor(model => model.LastName)
22-
</div>
23-
<div class="display-field">
24-
@Html.DisplayFor(model => model.LastName)
25-
</div>
26-
27-
<div class="display-label">
28-
@Html.DisplayNameFor(model => model.Address)
29-
</div>
30-
<div class="display-field">
31-
@Html.DisplayFor(model => model.Address)
32-
</div>
33-
34-
<div class="display-label">
35-
@Html.DisplayNameFor(model => model.Mobile)
36-
</div>
37-
<div class="display-field">
38-
@Html.DisplayFor(model => model.Mobile)
39-
</div>
40-
</fieldset>
419
@using (Html.BeginForm()) {
4210
@Html.AntiForgeryToken()
43-
<p>
44-
<input type="submit" value="Delete" /> |
45-
@Html.ActionLink("Back to List", "Index")
46-
</p>
11+
@Html.ValidationSummary(true)
12+
13+
<fieldset>
14+
<legend>CustomerModel</legend>
15+
16+
17+
<div class="editor-label">
18+
@Html.LabelFor(model => model.FirstName)
19+
</div>
20+
<div class="editor-field">
21+
@Html.EditorFor(model => model.FirstName)
22+
@Html.ValidationMessageFor(model => model.FirstName)
23+
</div>
24+
25+
<div class="editor-label">
26+
@Html.LabelFor(model => model.LastName)
27+
</div>
28+
<div class="editor-field">
29+
@Html.EditorFor(model => model.LastName)
30+
@Html.ValidationMessageFor(model => model.LastName)
31+
</div>
32+
33+
<div class="editor-label">
34+
@Html.LabelFor(model => model.Address)
35+
</div>
36+
<div class="editor-field">
37+
@Html.EditorFor(model => model.Address)
38+
@Html.ValidationMessageFor(model => model.Address)
39+
</div>
40+
41+
<div class="editor-label">
42+
@Html.LabelFor(model => model.Mobile)
43+
</div>
44+
<div class="editor-field">
45+
@Html.EditorFor(model => model.Mobile)
46+
@Html.ValidationMessageFor(model => model.Mobile)
47+
</div>
48+
49+
<p>
50+
<input type="submit" value="Save" />
51+
</p>
52+
</fieldset>
53+
}
54+
55+
<div>
56+
@Html.ActionLink("Back to List", "Index")
57+
</div>
58+
59+
@section Scripts {
60+
@Scripts.Render("~/bundles/jqueryval")
4761
}

Views/Customer/Index.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
@Html.DisplayFor(modelItem => item.Mobile)
4848
</td>
4949
<td>
50-
@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
51-
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
52-
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
50+
@Html.ActionLink("Edit", "Edit", new { id=item.ReferenceId }) |
51+
@Html.ActionLink("Details", "Details", new { id=item.ReferenceId }) |
52+
@Html.ActionLink("Delete", "Delete", new { id=item.ReferenceId })
5353
</td>
5454
</tr>
5555
}

bin/BookShopInventoryApp.dll

3 KB
Binary file not shown.

bin/BookShopInventoryApp.pdb

6 KB
Binary file not shown.

obj/Debug/BookShopInventoryApp.csproj.FileListAbsolute.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,4 @@ C:\Users\Theophilus.SIGNALALLIANCE\Desktop\DatabaseAssignment\bin\Microsoft.Web.
175175
C:\Users\Theophilus.SIGNALALLIANCE\Desktop\DatabaseAssignment\bin\WebMatrix.WebData.xml
176176
C:\Users\Theophilus.SIGNALALLIANCE\Desktop\DatabaseAssignment\obj\Debug\BookShopInventoryApp.dll
177177
C:\Users\Theophilus.SIGNALALLIANCE\Desktop\DatabaseAssignment\obj\Debug\BookShopInventoryApp.pdb
178+
C:\Users\Theophilus.SIGNALALLIANCE\Desktop\DatabaseAssignment\obj\Debug\BookShopInventoryApp.csprojResolveAssemblyReference.cache

0 commit comments

Comments
 (0)