@model List @{ bool? isClient = (bool?)ViewData["IsClient"]; } @if (Model == null) { Html.Label("None"); } else { DiseaseModel clubroot = Model.Where(d => d.Type == "Clubroot").FirstOrDefault(); DiseaseModel sclerotinia = Model.Where(d => d.Type == "Sclerotinia Stem Rot").FirstOrDefault(); List remainingDiseases = Model; if (clubroot != null) { remainingDiseases.Remove(clubroot);

Clubroot

@if (!isClient.HasValue || (isClient.HasValue && !isClient.Value)) { } @if (!isClient.HasValue || (isClient.HasValue && !isClient.Value)) { }
@Html.Label(new DiseaseModel().GetDisplayName(d => d.Observed))@Html.Label(new DiseaseModel().GetDisplayName(d => d.DateChecked)) @Html.Label(new DiseaseModel().GetDisplayName(d => d.Within30Entrance)) @Html.Label(new DiseaseModel().GetDisplayName(d => d.LowDrainage)) @Html.Label(new DiseaseModel().GetDisplayName(d => d.MachineryArea)) @Html.Label(new DiseaseModel().GetDisplayName(d => d.MaleBaysWalked))
@clubroot.Observed@clubroot.DateChecked @clubroot.Within30Entrance @clubroot.LowDrainage @clubroot.MachineryArea @clubroot.MaleBaysWalked
} if (sclerotinia != null) { remainingDiseases.Remove(sclerotinia);

Sclerotinia Stem Rot

@if (!isClient.HasValue || (isClient.HasValue && !isClient.Value)) { } @if (!isClient.HasValue || (isClient.HasValue && !isClient.Value)) { }
@Html.Label(new DiseaseModel().GetDisplayName(d => d.ObservedInCanopyInField)) @Html.Label(new DiseaseModel().GetDisplayName(d => d.ObservedInCanopyOutside)) @Html.Label(new DiseaseModel().GetDisplayName(d => d.OverThreshold)) @Html.Label(new DiseaseModel().GetDisplayName(d => d.Counts))@Html.Label(new DiseaseModel().GetDisplayName(d => d.PercentSclerotiniaAffected))
@sclerotinia.ObservedInCanopyInField @sclerotinia.ObservedInCanopyOutside @sclerotinia.OverThreshold @sclerotinia.Counts@sclerotinia.PercentSclerotiniaAffected
} if (remainingDiseases != null) {

Diseases

@if (remainingDiseases.Count > 0) { foreach (DiseaseModel disease in remainingDiseases) { } }
@Html.Label(new DiseaseModel().GetDisplayName(d => d.Type)) @Html.Label(new DiseaseModel().GetDisplayName(d => d.Frequency))
@disease.Type @disease.Frequency
} else { @Html.Label("None") } }