Skip to content

Commit dc1d2f4

Browse files
committed
Revert "Revert "TD-2469: Review comments implemented""
This reverts commit cc3f05b.
1 parent 34bda56 commit dc1d2f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public IActionResult EditContractInfo(int centreId, int? day, int? month, int? y
534534
[HttpPost]
535535
public IActionResult EditContractInfo(ContractTypeViewModel contractTypeViewModel, int? day, int? month, int? year)
536536
{
537-
if ((day != 0 && day != null) | (month != 0 && month != null) | (year != 0 && year != null))
537+
if ((day.GetValueOrDefault() != 0) || (month.GetValueOrDefault() != 0) || (year.GetValueOrDefault() != 0))
538538
{
539539
var validationResult = DateValidator.ValidateDate(day ?? 0, month ?? 0, year ?? 0);
540540
if (validationResult.ErrorMessage != null)
@@ -573,8 +573,8 @@ public IActionResult EditContractInfo(ContractTypeViewModel contractTypeViewMode
573573
return View(model);
574574
}
575575
DateTime? date = null;
576-
if ((day != 0 && day != null) && (month != 0 && month != null) && (year != 0 && year != null))
577-
{
576+
if ((day.GetValueOrDefault() != 0) || (month.GetValueOrDefault() != 0) || (year.GetValueOrDefault() != 0))
577+
{
578578
date = new DateTime(year ?? 0, month ?? 0, day ?? 0);
579579
}
580580
this.centresDataService.UpdateContractTypeandCenter(contractTypeViewModel.CentreId,

0 commit comments

Comments
 (0)