public string this[string propertyName] { get { try { string validationResult = String.Empty; if (ValidationEnabled) { switch (propertyName) { case "ID": if (_dbservicewms.CountPlaceIDs(ID) == 0 || ID.Length == 0) { validationResult = ResourceReader.GetString("ERR_LOC_RANGE"); } break; case "FrequencyClass": if (FrequencyClass < 0 || (FrequencyClass == 0 && ID.StartsWith("W"))) { validationResult = ResourceReader.GetString("ERR_RANGE"); } break; } } Validator.AddOrUpdate(propertyName, validationResult == String.Empty); AllPropertiesValid = Validator.IsValid(); return(validationResult); } catch (Exception e) { _warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception, string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message)); Validator.AddOrUpdate(propertyName, false); AllPropertiesValid = Validator.IsValid(); return(ResourceReader.GetString("ERR_EXCEPTION")); } } }