private static ObjectDefinitionField Convert2FileDefinitionField(GeneralObjectDefinitionField field) { var svcDefField = new ObjectDefinitionField(GeneralObjectDefinitionFieldType.File); svcDefField.GeneralObjectDefinitionFiledType = field.GeneralObjectDefinitionFiledType; svcDefField.ObjectDefinitionFieldID = field.GeneralObjectDefinitionFieldID; svcDefField.ObjectDefinitionFieldKey = field.GeneralObjectDefinitionFieldKey; svcDefField.ObjectDefinitionFieldName = field.GeneralObjectDefinitionFieldName; return(svcDefField); }
private static GeneralObjectDefinitionField ParseGeneralObjectDefinitionField(ObjectDefinitionField f, GeneralObjectDefinitionField field) { if (field == null) { field = new GeneralObjectDefinitionField(); } field.GeneralObjectDefinitionFieldKey = f.ObjectDefinitionFieldKey; field.GeneralObjectDefinitionFieldName = f.ObjectDefinitionFieldName; field.GeneralObjectDefinitionFiledType = f.GeneralObjectDefinitionFiledType; return(field); }
private static ObjectDefinitionField ConvertObjectDefField2SvcDefField(GeneralObjectDefinitionField field) { switch (field.GeneralObjectDefinitionFiledType) { case GeneralObjectDefinitionFieldType.File: return(Convert2FileDefinitionField(field)); case GeneralObjectDefinitionFieldType.ObjectReference: return(Convert2ObjectRefDefinitionField(field as ObjRefObjectDefinitionField)); case GeneralObjectDefinitionFieldType.PrimeType: return(Convert2ObjectPrimeDefinitionField(field as PrimeObjectDefintionField)); case GeneralObjectDefinitionFieldType.SingleSelection: return(Convert2ObjectSingleSelectionDefinitionField(field as SingleSelectionDefinitionField)); default: throw new NotSupportedException(string.Format("{0} is not supported.", field.GeneralObjectDefinitionFiledType)); } }
public static GeneralObjectDefinitionField ConvertSvcField2ObjDefinitionField(ObjectDefinitionField f, GeneralObjectDefinitionField field) { switch (f.GeneralObjectDefinitionFiledType) { case GeneralObjectDefinitionFieldType.PrimeType: return(ParsePrimeDefinitionField(f as PrimeDefinitionField, field as PrimeObjectDefintionField)); case GeneralObjectDefinitionFieldType.SingleSelection: return(ParseSingleSelectionDefinitionField(f as SingleSDefinitionField, field as SingleSelectionDefinitionField)); case GeneralObjectDefinitionFieldType.ObjectReference: return(ParseObjectReferenceDefinitionField(f as ObjRefDefinitionField, field as ObjRefObjectDefinitionField)); case GeneralObjectDefinitionFieldType.File: return(ParseGeneralObjectDefinitionField(f, field)); default: throw new NotSupportedException(string.Format("{0} is not supported!", f.GeneralObjectDefinitionFiledType)); } }