public static ValidationResult HasValidFixedAssetQuantity(SurplusRequest surplusRequest) { var barcode = surplusRequest.VTBarcode; if (barcode == WebConfigurationManager .AppSettings["notFixedAssetSentinel"]) { return ValidationResult.Success; } else if (surplusRequest.Quantity == 1) { return ValidationResult.Success; } return new ValidationResult("Fixed assets must have a " + "quantity of (1).", new List<string>() { "Quantity" }); }
public static ValidationResult HasValidFixedAssetQuantityDescription(SurplusRequest surplusRequest) { var barcode = surplusRequest.VTBarcode; if (barcode == WebConfigurationManager .AppSettings["notFixedAssetSentinel"]) { return ValidationResult.Success; } else if (surplusRequest.QuantityDescriptionId.ToString().ToUpper() == WebConfigurationManager .AppSettings["validFixedAssetQuantityDescriptionId"].ToUpper()) { return ValidationResult.Success; } return new ValidationResult("Fixed assets must have a " + "quantity description of \"Each.\"", new List<string>() { "QuantityDescriptionId" }); }