public void SetValue(SubmissionFieldBaseValue valueItem) { if (valueItem != null) { if (valueItem is SubmissionFieldStringValue) { Value = new dtoValueField(((SubmissionFieldStringValue)valueItem).Value, ((SubmissionFieldStringValue)valueItem).UserValue); } else if (valueItem is SubmissionFieldFileValue) { SubmissionFieldFileValue fileValue = (SubmissionFieldFileValue)valueItem; Value = new dtoValueField(fileValue.Link); } IdValueField = valueItem.Id; } }
public dtoSubmissionValueField(FieldDefinition definition, SubmissionFieldBaseValue valueItem, long revNumber) : this(definition) { if (valueItem != null) { if (valueItem is SubmissionFieldStringValue) { Value = new dtoValueField(((SubmissionFieldStringValue)valueItem).Value, ((SubmissionFieldStringValue)valueItem).UserValue); } else if (valueItem is SubmissionFieldFileValue) { SubmissionFieldFileValue fileValue = (SubmissionFieldFileValue)valueItem; Value = new dtoValueField(fileValue.Link); } IdValueField = valueItem.Id; } RevisionsCount = revNumber; //else if (Mandatory) // FieldError = FieldError.Mandatory; }