В части просмотра:
@using (Ajax.BeginForm("DoFUPTrialDecision", "Home", new AjaxOptions { UpdateTargetId = "FUPTrialInputs" }))
{
@Html.Hidden("ClientLoanID", Model.ClientLoanID)
<table >
<tr>
<th class="td2Fld" >
Unemployment Benefits Effective:
</th>
<td class="SrcFld">
<div>
@Html.TextBox("BeginDate", Model.BeginDate)
@Html.RequiredFieldFor(model => model.BeginDate)
@Html.ValidationMessageFor(model => model.BeginDate)
To @Html.TextBox("EndDate", Model.EndDate)
@Html.RequiredFieldFor(model => model.EndDate)
@Html.ValidationMessageFor(model => model.EndDate)
</div>
}
В модели:
public class UnEmploymentInputs : UserInputs
{
[Required]
public DateTime? BeginDate { get; set; }
[Required]
[GreaterThan("BeginDate")]
public DateTime? EndDate { get; set; }
public decimal? NonEscrowTax { get; set; }
public decimal? NonEscrowInsurance { get; set; }
public bool? IsExtension { get; set; }
public bool? IsIncomeCircumstance { get; set; }
}
public class HUPTrialInputs : UnEmploymentInputs
{
[Required(ErrorMessage = "Previous Plan duration is invalid")]
[DisplayName("Previous Plan Duration")]
public short PreviousPlanDuration { get; set; }
}
public class FUPTrialInputs : UnEmploymentInputs
{
public short ExtensionDuration { get; set; }
public bool IsPreviouslyApproved { get; set; }
public bool IsPreviouslyDelinquencyCured { get; set; }
public decimal RentalIncome { get; set; }
public decimal MonthlySecuredDebts { get; set; }
}