Пример #1
0
        /// <summary>
        /// Validates the claim.
        /// </summary>
        /// <returns>The claim.</returns>
        /// <param name="claim">Claim.</param>
        public ValidationResults ValidateClaim(ClaimInputs claim)
        {
            if (claim == null)
            {
                throw new ArgumentNullException(nameof(claim), "Cannot be null.");
            }

            var validationResults = new ValidationResults();

            if (string.IsNullOrEmpty(claim.workAssignmentPK))
            {
                validationResults.AddValidationError("The claim workAssignmentPK cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(claim.orgId))
            {
                validationResults.AddValidationError("The claim orgId cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(claim.vehicleOwnerLastName))
            {
                validationResults.AddValidationError("The claim vehicleOwnerLastName cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(claim.taskId))
            {
                validationResults.AddValidationError("The claim taskId cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(claim.assignmentNote))
            {
                validationResults.AddValidationError("The claim assignmentNote cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(claim.roleCode))
            {
                validationResults.AddValidationError("The claim roleCode cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(claim.vehicleOwnerFirstName))
            {
                validationResults.AddValidationError("The claim vehicleOwnerFirstName cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(claim.businessCategory))
            {
                validationResults.AddValidationError("The claim businessCategory cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(claim.claimNumber))
            {
                validationResults.AddValidationError("The claim claimNumber cannot be null or empty.");
            }

            return(validationResults);
        }