예제 #1
0
 private WebDataField GetDataField(Boolean refresh = false)
 {
     if (_dataField.IsNull() || refresh)
     {
         _dataField = GetOneDataField(WebDataType.Int32);
     }
     return(_dataField);
 }
예제 #2
0
        public WebDataField GetDataField(Boolean refresh = false)
        {
            if (_dataField.IsNull() || refresh)
            {
                _dataField = new WebDataField();
            }

            return(_dataField);
        }
예제 #3
0
        /// <summary>
        /// Get the project id value, it is the id of the related project,
        /// used for columns of a ProjectParameter type.
        /// </summary>
        /// <param name="webSpeciesObservationFieldMapping">The object</param>
        /// <returns>The project id value, if none found null is returned</returns>
        public static Int32?GetProjectId(this WebSpeciesObservationFieldMapping webSpeciesObservationFieldMapping)
        {
            if (webSpeciesObservationFieldMapping.DataFields.IsEmpty())
            {
                return(null);
            }

            WebDataField field = webSpeciesObservationFieldMapping.DataFields.FirstOrDefault(item => item.Name == "ProjectId");

            if (field.IsNull())
            {
                return(null);
            }
            else
            {
                // ReSharper disable once PossibleNullReferenceException
                return(field.Value.WebParseInt32());
            }
        }