public void CreateNewSpeciesObservationTableType(SpeciesObservationTableTypeViewModel tableType)
        {
            UserDefinedTable userDefinedTable = new UserDefinedTable();

            userDefinedTable.Title    = tableType.Title;
            userDefinedTable.FieldIds = tableType.FieldIds;
            TableSettings.SpeciesObservationTable.UserDefinedTables.Add(userDefinedTable);
            TableSettings.SpeciesObservationTable.UseUserDefinedTableType = true;
            TableSettings.SpeciesObservationTable.SelectedTableId         = TableSettings.SpeciesObservationTable.UserDefinedTables.Count - 1;
        }
Esempio n. 2
0
        public SpeciesObservationTableSettingsViewModel CreateSpeciesObservationTableSettingsViewModel()
        {
            var model = new SpeciesObservationTableSettingsViewModel();

            model.UseUserDefinedTableType = TableSetting.SpeciesObservationTable.UseUserDefinedTableType;
            model.SelectedTableId         = TableSetting.SpeciesObservationTable.SelectedTableId;
            model.UseLabelAsColumnHeader  = TableSetting.SpeciesObservationTable.UseLabelAsColumnHeader;
            model.SystemDefinedTables     = TableSetting.SpeciesObservationTable.SystemDefinedTables;
            model.UserDefinedTables       = new List <TableTypeViewModel>();
            for (int i = 0; i < TableSetting.SpeciesObservationTable.UserDefinedTables.Count; i++)
            {
                UserDefinedTable table = TableSetting.SpeciesObservationTable.UserDefinedTables[i];
                model.UserDefinedTables.Add(new TableTypeViewModel(i, table.Title));
            }
            model.IsSettingsDefault = TableSetting.SpeciesObservationTable.IsSettingsDefault();
            return(model);
        }