private bool checkBuying(Buying buy) { return(buy != null && buy.Package.Any(it => it.Drink > 500 || it.Agriculture > 500 || it.Factory > 500 || it.Service > 500 )); }
private double CalcBuying(Buying buying) { var sum = ((buying?.Package?.Where(it => it != null).Sum(it => (it.Size ?? 0) * (it.Drink ?? 0) / (!string.IsNullOrEmpty(it.Name) && it.Name.Contains("ขวด") ? 1000 : 1))) ?? 0) * 12 / 100.0; return(sum); }