• Thank you, the insert will be only used for our data conversion and migration from old application database to new application database, it will be removed later after data conversion.

    Also the application code does that check too, but the developer like database to do the constraints too.

    public bool IsValid()

    {

    if (_caseStatus.IsEndState && _closedDate == null)

    {

    BrokenRuleMessage = "Selected status requires Closed Date";

    return false;

    }

    if (!_caseStatus.IsEndState && _closedDate != null)

    {

    BrokenRuleMessage = "Closed Date not allowed with selected status";

    return false;

    }

    if (_closedDate.GetValueOrDefault().Date > DateTime.Today)

    {

    BrokenRuleMessage = "Future Closed Date not allowed";

    return false;

    }

    return true;

    }