public PartialViewResult TableFieldDescription(int fieldId)
        {
            var viewManager = new SpeciesObservationFieldDescriptionViewManager(GetCurrentUser(), SessionHandler.MySettings);
            TableFieldDescriptionViewModel model = viewManager.GetTableFieldDescription(fieldId);

            return(PartialView(model));
        }
        /// <summary>
        /// Gets a table field description.
        /// </summary>
        /// <param name="fieldId">The field id.</param>
        public TableFieldDescriptionViewModel GetTableFieldDescription(int fieldId)
        {
            SpeciesObservationFieldDescriptionList fields = CoreData.MetadataManager.GetSpeciesObservationFieldDescriptions(UserContext);

            return((from ISpeciesObservationFieldDescription field in fields
                    where field.Id == fieldId
                    select TableFieldDescriptionViewModel.CreateFromSpeciesObservationFieldDescription(field)).FirstOrDefault());
        }
        /// <summary>
        /// Gets the table fields for a specific table.
        /// </summary>
        /// <param name="tableId">The table id.</param>
        /// <param name="useUserDefinedTable">if true the tableId refers to a user defined table.</param>
        public List <TableFieldDescriptionViewModel> GetTableFields(int tableId, bool useUserDefinedTable)
        {
            List <ISpeciesObservationFieldDescription> tableFields = TableSettings.SpeciesObservationTable.GetTableFields(UserContext, tableId, useUserDefinedTable);
            List <TableFieldDescriptionViewModel>      list        = new List <TableFieldDescriptionViewModel>();

            foreach (ISpeciesObservationFieldDescription fieldDescription in tableFields)
            {
                list.Add(TableFieldDescriptionViewModel.CreateFromSpeciesObservationFieldDescription(fieldDescription));
            }
            return(list);
        }
        public List <TableFieldDescriptionViewModel> GetAllSelectableTableFields()
        {
            const int LeastImportance = 5;
            List <ISpeciesObservationFieldDescription> tableFields = TableSettings.SpeciesObservationTable.GetTableFieldsByImportance(UserContext, LeastImportance);
            List <TableFieldDescriptionViewModel>      list        = new List <TableFieldDescriptionViewModel>();

            foreach (ISpeciesObservationFieldDescription fieldDescription in tableFields)
            {
                list.Add(TableFieldDescriptionViewModel.CreateFromSpeciesObservationFieldDescription(fieldDescription));
            }

            return(list);
        }