AgGateway.ADAPT.ISOv4Plugin.Loaders.PrescriptionLoader.LoadFieldAndCropZone C# (CSharp) Method

LoadFieldAndCropZone() private method

private LoadFieldAndCropZone ( string fieldId, AgGateway.ADAPT.ApplicationDataModel.Prescriptions.RasterGridPrescription prescription ) : void
fieldId string
prescription AgGateway.ADAPT.ApplicationDataModel.Prescriptions.RasterGridPrescription
return void
        private void LoadFieldAndCropZone(string fieldId, RasterGridPrescription prescription)
        {
            if (string.IsNullOrEmpty(fieldId))
                return;

            var cropZone = _taskDocument.CropZones.FindById(fieldId);
            if (cropZone != null)
            {
                prescription.CropZoneId = cropZone.Id.ReferenceId;
                prescription.FieldId = cropZone.FieldId;
            }
            else
            {
                var field = _taskDocument.Fields.FindById(fieldId);
                if (field != null)
                    prescription.FieldId = field.Id.ReferenceId;
            }
        }