Exemplo n.º 1
0
    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;
    }
Exemplo n.º 2
0
    private string ValidateRecordingActAsCompleteCommandHandler() {
      int recordingActId = int.Parse(GetCommandParameter("recordingActId", true));

      RecordingAct recordingAct = RecordingAct.Parse(recordingActId);

      LandRegistrationException exception = null;

      exception = LRSValidator.ValidateRecordingActAsComplete(recordingAct);
      if (exception != null) {
        return exception.Message;
      }
      return String.Empty;
    }
Exemplo n.º 3
0
    private string GetOverlappingRecordingsCountCommandHandler() {
      int recordingBookId = int.Parse(GetCommandParameter("recordingBookId", true));
      int recordingId = int.Parse(GetCommandParameter("recordingId", true));
      int imageStartIndex = int.Parse(GetCommandParameter("imageStartIndex", true));
      int imageEndIndex = int.Parse(GetCommandParameter("imageEndIndex", true));

      RecordingBook recordingBook = RecordingBook.Parse(recordingBookId);
      Recording recording = null;
      if (recordingId != 0) {
        recording = Recording.Parse(recordingId);
      } else {
        recording = Recording.Empty;
      }
      return LRSValidator.GetOverlappingRecordingsCount(recordingBook, recording,
                                                        imageStartIndex, imageEndIndex).ToString();
    }
Exemplo n.º 4
0
    private string ValidateDeleteRecordingActPropertyCommandHandler() {
      int recordingId = int.Parse(GetCommandParameter("recordingId", true));
      int recordingActId = int.Parse(GetCommandParameter("recordingActId", true));
      int propertyId = int.Parse(GetCommandParameter("propertyId", true));

      Recording recording = Recording.Parse(recordingId);
      RecordingAct recordingAct = recording.GetRecordingAct(recordingActId);
      Property property = recordingAct.GetPropertyEvent(Property.Parse(propertyId)).Property;

      LandRegistrationException exception = null;
      exception = LRSValidator.ValidateDeleteRecordingActProperty(recordingAct, property);

      if (exception != null) {
        return exception.Message;
      }
      return String.Empty;
    }
Exemplo n.º 5
0
    private string FindAnnotationIdCommandHandler() {
      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);

      return LRSValidator.FindAnnotationId(recordingBook, annotationType,
                                           Recording.FormatNumber(number, useBisNumber),
                                           imageStartIndex, imageEndIndex, presentationTime,
                                           authorizationDate, authorizedBy, property).ToString();
    }
Exemplo n.º 6
0
    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;
    }