private string ValidateAnnotationSemanticsCommandHandler() { int annotationBookId = int.Parse(GetCommandParameter("annotationBookId", true)); int annotationTypeId = int.Parse(GetCommandParameter("annotationTypeId", true)); int number = int.Parse(GetCommandParameter("number", false)); bool useBisNumber = bool.Parse(GetCommandParameter("useBisNumber", true)); int imageStartIndex = int.Parse(GetCommandParameter("imageStartIndex", true)); int imageEndIndex = int.Parse(GetCommandParameter("imageEndIndex", true)); int propertyId = int.Parse(GetCommandParameter("propertyId", true)); DateTime presentationTime = EmpiriaString.ToDateTime(GetCommandParameter("presentationTime", false, ExecutionServer.DateMinValue.ToString("dd/MMM/yyyy"))); DateTime authorizationDate = EmpiriaString.ToDate(GetCommandParameter("authorizationDate", false, ExecutionServer.DateMaxValue.ToString("dd/MMM/yyyy"))); int authorizedById = int.Parse(GetCommandParameter("authorizedById", false, "-1")); RecordingBook recordingBook = RecordingBook.Parse(annotationBookId); RecordingActType annotationType = RecordingActType.Parse(annotationTypeId); Person authorizedBy = Person.Parse(authorizedById); Property property = Property.Parse(propertyId); LandRegistrationException exception = null; if (presentationTime != ExecutionServer.DateMinValue) { exception = LRSValidator.ValidateRecordingDates(recordingBook, Recording.Empty, presentationTime, authorizationDate); if (exception != null) { return exception.Message; } } exception = LRSValidator.ValidateRecordingAuthorizer(recordingBook, authorizedBy, authorizationDate); if (exception != null) { return exception.Message; } return String.Empty; }
private string ValidateRecordingSemanticsCommandHandler() { int recordingBookId = int.Parse(GetCommandParameter("recordingBookId", true)); int recordingId = int.Parse(GetCommandParameter("recordingId", true)); int number = int.Parse(GetCommandParameter("number", false)); bool useBisNumber = bool.Parse(GetCommandParameter("useBisNumber", false, "false")); int imageStartIndex = int.Parse(GetCommandParameter("imageStartIndex", true)); int imageEndIndex = int.Parse(GetCommandParameter("imageEndIndex", true)); DateTime presentationTime = EmpiriaString.ToDateTime(GetCommandParameter("presentationTime", false, ExecutionServer.DateMinValue.ToString("dd/MMM/yyyy"))); DateTime authorizationDate = EmpiriaString.ToDate(GetCommandParameter("authorizationDate", false, ExecutionServer.DateMaxValue.ToString("dd/MMM/yyyy"))); int authorizedById = int.Parse(GetCommandParameter("authorizedById", false, "-1")); RecordingBook recordingBook = RecordingBook.Parse(recordingBookId); Recording recording = null; Person authorizedBy = Person.Parse(authorizedById); if (recordingId != 0) { recording = Recording.Parse(recordingId); } else { recording = new Recording(); } LandRegistrationException exception = null; exception = LRSValidator.ValidateRecordingNumber(recordingBook, recording, number, useBisNumber, imageStartIndex, imageEndIndex); if (exception != null) { return exception.Message; } if (presentationTime != ExecutionServer.DateMinValue) { exception = LRSValidator.ValidateRecordingDates(recordingBook, recording, presentationTime, authorizationDate); if (exception != null) { return exception.Message; } } exception = LRSValidator.ValidateRecordingAuthorizer(recordingBook, authorizedBy, authorizationDate); if (exception != null) { return exception.Message; } return String.Empty; }