public SalePicture ValidateBusinessRules() { ExceptionHelpers.Assert(this.SaleId.HasValue); ExceptionHelpers.Assert(this.ImageData != null && this.ImageData.Length > 0); ExceptionHelpers.Assert(string.IsNullOrEmpty(this.Description) == false); return(this); }
public SaleDate ValidateBusinessRules() { ExceptionHelpers.Assert(this.SaleId.HasValue); ExceptionHelpers.Assert(this.UtcStartDate.HasValue); ExceptionHelpers.Assert(this.UtcEndDate.HasValue); ExceptionHelpers.Assert(this.UtcStartDate < this.UtcEndDate); return(this); }
public Sale ValidateBusinessRules() { ExceptionHelpers.Assert(this.OrgId.HasValue); ExceptionHelpers.Assert(this.SaleType.HasValue); ExceptionHelpers.Assert(Validators.RequiredShortString.IsValid(this.name)); ExceptionHelpers.Assert(Validators.RequiredShortString.IsValid(this.address)); ExceptionHelpers.Assert(Validators.PostalCode.IsValid(this.postalCodeNumber)); ExceptionHelpers.Assert(Validators.OptionalLongString.IsValid(this.directions)); ExceptionHelpers.Assert(Validators.OptionalLongString.IsValid(this.description)); ExceptionHelpers.Assert(Validators.OptionalLongString.IsValid(this.terms)); ExceptionHelpers.Assert(this.ShowAddressType.HasValue); if (string.IsNullOrEmpty(this.AuctionUrl) == false) { ExceptionHelpers.Assert(this.SaleType == Models.SaleType.OnlineOnlyAuctions); } return(this); }