public void DeleteCheckedHealthRecords(bool withCancel = true) { GetSelectedHrs().ForAll(hr => { if (withCancel) { hr.IsDeleted = true; } else { holder.RemoveHealthRecord(hr); } }); }
private static IEnumerable <HealthRecord> RemoveEmptyHrs(IHrsHolder holder) { Contract.Requires(holder != null); Contract.Ensures(holder.HealthRecords.All(x => !x.IsEmpty())); var emptyHrs = holder.HealthRecords.Where(hr => hr.IsEmpty()).ToList(); emptyHrs.ForEach(hr => holder.RemoveHealthRecord(hr)); return(emptyHrs); }