private void LoadProducts(TreatmentZone treatmentZone, RasterGridPrescription prescription)
{
var productIds = new List<int>();
foreach (var dataVariable in treatmentZone.Variables)
{
Product product = _taskDocument.CropVarieties.FindById(dataVariable.ProductId)
?? (_taskDocument.Products.FindById(dataVariable.ProductId)
?? _taskDocument.ProductMixes.FindById(dataVariable.ProductId));
productIds.Add(product == null ? 0 : product.Id.ReferenceId);
}
prescription.ProductIds = productIds;
}