Ejemplo n.º 1
0
        private Field GetField_By_Id(int Id, DocsMarshal.Entities.Enums.EFieldType Type)
        {
            var Field = GetField_By_Id(Id);

            if (Field.FieldType != Type)
            {
                throw new InvalidCastException(string.Format("Field with Id {0} is not of type {1}", Id, Type.ToString()));
            }
            else
            {
                return(Field);
            }
        }
Ejemplo n.º 2
0
        private Field GetField_By_ExternalId(string ExternalId, DocsMarshal.Entities.Enums.EFieldType Type)
        {
            var Field = GetField_By_ExternalId(ExternalId);

            if (Field.FieldType != Type)
            {
                throw new InvalidCastException(string.Format("Field with ExternalId {0} is not of type {1}", ExternalId, Type.ToString()));
            }
            else
            {
                if (string.IsNullOrWhiteSpace(Field.DbFieldName))
                {
                    Field.DbFieldName = GetDbFieldCodeByFieldId(Field.Id);
                }
                return(Field);
            }
        }