());
+ }
+ }
+
public class Auction
{
public long Id { get; set; }
+
+ [Required]
+ [StringLength(50,
+ ErrorMessage = "Title cannot be longer than 50 characters")]
public string Title { get; set; }
+
+ [Required]
public string Description { get; set; }
+
+ [Range(1, 10000,
+ ErrorMessage = "The auction's starting price must be at least 1")]
public decimal StartPrice { get; set; }
+
public decimal CurrentPrice { get; set; }
- public DateTime StartTime { get; set; }
+
public DateTime EndTime { get; set; }
}
}
\ No newline at end of file
diff --git a/Ebuy.Website/Views/Auctions/Create.cshtml b/Ebuy.Website/Views/Auctions/Create.cshtml
new file mode 100644
index 0000000..bbf6410
--- /dev/null
+++ b/Ebuy.Website/Views/Auctions/Create.cshtml
@@ -0,0 +1,32 @@
+@model Ebuy.Website.Models.Auction
+
+Create Auction
+
+@using (Html.BeginForm())
+{
+ @Html.ValidationSummary()
+
+
+ @Html.LabelFor(model => model.Title)
+ @Html.EditorFor(model => model.Title)
+ @Html.ValidationMessageFor(model => model.Title, "*")
+
+
+ @Html.LabelFor(model => model.Description)
+ @Html.EditorFor(model => model.Description)
+ @Html.ValidationMessageFor(model => model.Description, "*")
+
+
+ @Html.LabelFor(model => model.StartPrice)
+ @Html.EditorFor(model => model.StartPrice)
+ @Html.ValidationMessageFor(model => model.StartPrice)
+
+
+ @Html.LabelFor(model => model.EndTime)
+ @Html.EditorFor(model => model.EndTime)
+ @Html.ValidationMessageFor(model => model.EndTime)
+
+
+
+
+}
\ No newline at end of file
diff --git a/Ebuy.Website/Views/Auctions/Details.cshtml b/Ebuy.Website/Views/Auctions/Details.cshtml
index d5532b2..45a6270 100644
--- a/Ebuy.Website/Views/Auctions/Details.cshtml
+++ b/Ebuy.Website/Views/Auctions/Details.cshtml
@@ -37,13 +37,6 @@
@Html.DisplayFor(model => model.CurrentPrice)
-
- @Html.DisplayNameFor(model => model.StartTime)
-
-
- @Html.DisplayFor(model => model.StartTime)
-
-
@Html.DisplayNameFor(model => model.EndTime)