private static Settings.VolumeNecessaryDetail GetMaxFromDetail(this Settings.VolumeNecessary volumeNecessary, decimal netLot) { if (volumeNecessary.VolumeNecessaryDetails.Count == 0) { return(null); } Settings.VolumeNecessaryDetail result = null; decimal maxFrom = decimal.MinValue; foreach (var eachDetail in volumeNecessary.VolumeNecessaryDetails) { if (eachDetail.From < netLot && maxFrom < eachDetail.From) { maxFrom = eachDetail.From; result = eachDetail; } } return(result); }
private static decimal GetMargin(this Settings.VolumeNecessaryDetail volumeNecessaryDetail, bool isNight) { return(isNight ? volumeNecessaryDetail.MarginO : volumeNecessaryDetail.MarginD); }