Skip to content

@req DT-22646 #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions WebGoat.NET/Views/Product/AddOrEdit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,19 @@
<legend>Product information</legend>
@if (!Model.AddsNew)
{
#pragma warning disable CS8602 // False positive, cannot happen in template usage
Html.HiddenFor(m => m.Product.ProductId);
Html.HiddenFor(m => m.Product.SupplierId);
#pragma warning restore CS8602
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.LabelFor(m => m.Product.ProductId)
@{ #pragma warning restore CS8602 }
<span class="textEntry">@Model.Product?.ProductId</span>
</p>
}
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.LabelFor(m => m.Product.ProductName)
@Html.TextBoxFor(m => m.Product.ProductName, new { @value = Model.Product?.ProductName })
@Html.ValidationMessageFor(m => m.Product.ProductName)
@{ #pragma warning restore CS8602 }
</p>
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.LabelFor(m => m.Product.Category)
<select asp-for="Product.CategoryId">
@foreach (var category in Model.ProductCategories)
Expand All @@ -47,9 +40,7 @@
</option>
}
</select>
@{ #pragma warning restore CS8602 }
</p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
<p>
@Html.LabelFor(m => m.Product.QuantityPerUnit)
@Html.TextBoxFor(m => m.Product.QuantityPerUnit, new { @value = Model.Product?.QuantityPerUnit })
Expand All @@ -75,11 +66,9 @@
@Html.TextBoxFor(m => m.Product.ReorderLevel, new { @value = Model.Product?.ReorderLevel })
@Html.ValidationMessageFor(m => m.Product.ReorderLevel)
</p>
@{ #pragma warning restore CS8602 }
@if (Model.AddsNew)
{
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.LabelFor(m => m.Product.Supplier)
@if(Model.Suppliers != null)
{
Expand All @@ -93,14 +82,11 @@
</select>
}
@Html.ValidationMessageFor(m => m.Product.Supplier)
@{ #pragma warning restore CS8602 }
</p>
}
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.CheckBoxFor(m => m.Product.Discontinued, new { @checked = Model.Product?.Discontinued ?? false })
@Html.LabelFor(m => m.Product.Discontinued)
@{ #pragma warning restore CS8602 }
</p>
</fieldset>
<p class="submitButton">
Expand Down
Loading