Skip to content

Instantly share code, notes, and snippets.

@mps
Created March 18, 2011 19:33
Show Gist options
  • Save mps/876691 to your computer and use it in GitHub Desktop.
Save mps/876691 to your computer and use it in GitHub Desktop.
Excluded
Func<PersDriver, bool> unverifiableMvr = d => d.Mvr == null || d.Mvr.MvrStatusCd != MvrStatus.Received || d.ViolationsChanged;
Func<PersDriver, bool> notExcluded = d => d.DriverStatusCd != DriverStatus.Excluded;
Func<PersVehicle, bool> requirePhoto = v => (((p.EffectiveDt.Year - v.ModelYear) + (p.EffectiveDt.Month >= 10 ? 1 : 0)) > 13) && !v.IsLiabilityOnly;
Func<bool> requireReceipt = () => p.Vehicles.Count / p.RatedDriverCount > 3;
if (p.Drivers.Any(unverifiableMvr) && p.Drivers.Any(notExcluded))
{
pd["suspenseheader1"] = "Unverifiable MVR. Please fax an enlarged copy of current driver's license for:";
pd["suspense1"] = p.Drivers.Where(unverifiableMvr).Where(notExcluded).Aggregate("", (current, d) => current + d.Name.FullName + "\r\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment