public static HistoricVariableUpdateDto fromHistoricVariableUpdate(HistoricVariableUpdate historicVariableUpdate) { HistoricVariableUpdateDto dto = new HistoricVariableUpdateDto(); fromHistoricVariableUpdate(dto, historicVariableUpdate); return(dto); }
protected internal static void fromHistoricVariableUpdate(HistoricVariableUpdateDto dto, HistoricVariableUpdate historicVariableUpdate) { dto.revision = historicVariableUpdate.Revision; dto.variableName = historicVariableUpdate.VariableName; dto.variableInstanceId = historicVariableUpdate.VariableInstanceId; if (string.ReferenceEquals(historicVariableUpdate.ErrorMessage, null)) { try { VariableValueDto variableValueDto = VariableValueDto.fromTypedValue(historicVariableUpdate.TypedValue); dto.value = variableValueDto.Value; dto.variableType = variableValueDto.Type; dto.valueInfo = variableValueDto.ValueInfo; } catch (Exception e) { dto.errorMessage = e.Message; dto.variableType = VariableValueDto.toRestApiTypeName(historicVariableUpdate.TypeName); } } else { dto.errorMessage = historicVariableUpdate.ErrorMessage; dto.variableType = VariableValueDto.toRestApiTypeName(historicVariableUpdate.TypeName); } }
public static HistoricDetailDto fromHistoricDetail(HistoricDetail historicDetail) { HistoricDetailDto dto = null; if (historicDetail is HistoricFormField) { HistoricFormField historicFormField = (HistoricFormField)historicDetail; dto = HistoricFormFieldDto.fromHistoricFormField(historicFormField); } else if (historicDetail is HistoricVariableUpdate) { HistoricVariableUpdate historicVariableUpdate = (HistoricVariableUpdate)historicDetail; dto = HistoricVariableUpdateDto.fromHistoricVariableUpdate(historicVariableUpdate); } fromHistoricDetail(historicDetail, dto); return(dto); }