/// <summary> /// Check is input crop plan is not equal to current model /// </summary> private bool IsInputCropPlanValid(CropPlan.ListItem cropPlan) { if (IsCropPlan) { return(ObjectId != cropPlan.OutlineID); } else { return(true); } }
private static ObjectModel ConvertToModelFromCropPlan(CropPlan.ListItem cropPlan, IDirectoryManager directoryManager) { var result = new ObjectModel { IsSingleObject = true, IsCropPlan = true, ObjectId = cropPlan.OutlineID }; string fieldName = string.Empty; var fieldVersion = directoryManager.FieldVersions.FirstOrDefault(x => x.CropPlans.FirstOrDefault(y => y.Identity == cropPlan.Identity) != null); if (fieldVersion != null) { fieldName = fieldVersion.FVersField.FldNumber; } result.DisplayFrom = string.Format("Поле - {0}, Посівна площа - {1} ({2} га.)", fieldName, cropPlan.CropPlanCultCrop.CultCropName, cropPlan.CropPlanArea); return(result); }