This is my code:
@model SSTModel.SharePurchaseModel
@{
Layout = "~/Views/Shared/_DefaultLayout.cshtml";
}
<div class="card" style="margin-top: 50px;max-width: 500px">
<div class="card-body">
<div class="form-header blue accent-1">
<h3 class="mt-2">
Share Purchase
</h3>
</div>
@Html.ValidationSummary()
@using (Html.BeginForm())
{
@Html.HiddenFor(x => x.SharePurchase.Id)
@Html.HiddenFor(x => x.SharePurchase.PortfolioId)
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.PurchaseDate, "{0:MM/dd/yyyy}", new {@class = "form-control form-control-sm validate", @id = "modalLRInput4" })
<label for="modalLRInput4">Purchase Date (format = MM/dd/yyyy)</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.ShareCode, new { @class = "form-control form-control-sm validate", @id = "modalLRInput1" })
<label for="modalLRInput1">Share Code</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.Quantity, new { @class = "form-control form-control-sm validate", @id = "modalLRInput2" })
<label for="modalLRInput2">Quantity</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.PurchasePrice, new { @class = "form-control form-control-sm validate", @id = "modalLRInput3" })
<label for="modalLRInput3">Purchase Price per Share</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.FinanceAmount, new {@class = "form-control form-control-sm validate", @id = "modalLRInput5"})
<label for="modalLRInput5">Amount Financed ($)</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.BrokerFees, new { @class = "form-control form-control-sm validate", @id = "modalLRInput8" })
<label for="modalLRInput8">Broker Fees on Purchase</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.SellDate, "{0:MM/dd/yyyy}", new { @class = "form-control form-control-sm validate", @id = "modalLRInput6" })
<label for="modalLRInput6">Date Sold (format = MM/dd/yyyy)</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.SellPrice, new { @class = "form-control form-control-sm validate", @id = "modalLRInput7" })
<label for="modalLRInput7">Sell Price per Share</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.TextBoxFor(x => x.SharePurchase.SaleFees, new {@class = "form-control form-control-sm validate", @id = "modalLRInput9"})
<label for="modalLRInput9">Broker Fees on Sale</label>
</div>
<div class="form-group md-form form-sm mb-5">
@Html.DropDownListFor(x => x.SharePurchase.MarketCode, new SelectList(Model.Markets,"Code","Market"),new { @class = "mdb-select", @id = "modalLRInput10" })
<label for="modalLRInput10">Market</label>
</div>
<button type="submit" class="btn btn-primary">Save</button>
@Html.ActionLink("Cancel", "Index", "Home",null, new { @class = "btn btn-default" })
}
</div>
</div>