public List <Dictionary <ViewTableField, string> > GetTableResult( CoordinateSystemId coordinateSystemId, SpeciesObservationTableColumnsSetId speciesObservationTableColumnsSetId) { SpeciesObservationsData speciesObservationsData = GetSpeciesObservations(coordinateSystemId); var viewManager = new SpeciesObservationTableViewManager(UserContext, MySettings); ViewTableViewModel viewModel = viewManager.CreateViewTableViewModel(speciesObservationTableColumnsSetId); var speciesObservationDataManager = new SpeciesObservationDataManager(UserContext, MySettings); List <Dictionary <ViewTableField, string> > dicResult = speciesObservationDataManager.GetObservationsListDictionary(speciesObservationsData.SpeciesObservationViewModels, viewModel.TableFields); return(dicResult); }
public List <Dictionary <string, string> > GetTablePagedResult(int start, int pageSize) { SpeciesObservationFieldDescriptionViewManager fieldDescriptionViewManager = new SpeciesObservationFieldDescriptionViewManager(UserContext, MySettings); SpeciesObservationFieldDescriptionsViewModel fieldDescriptionsViewModel = fieldDescriptionViewManager.CreateSpeciesObservationFieldDescriptionsViewModel(); SpeciesObservationList speciesObservationList = GetPagedSpeciesObservationList(start, pageSize, null, null); SpeciesObservationsData speciesObservationsData = new SpeciesObservationsData(speciesObservationList, fieldDescriptionsViewModel); var viewManager = new SpeciesObservationTableViewManager(UserContext, MySettings); ViewTableViewModel viewModel = viewManager.CreateViewTableViewModel(); var speciesObservationDataManager = new SpeciesObservationDataManager(UserContext, MySettings); List <Dictionary <string, string> > dicResult = speciesObservationDataManager.GetObservationsDataList(speciesObservationsData.SpeciesObservationViewModels, viewModel.TableFields); return(dicResult); }
public List <Dictionary <string, string> > GetTablePagedResultInBbox(int start, int pageSize, double bottom, double left, double right, double top) { Polygon bbox = GetPolygon(bottom, left, right, top); SpeciesObservationList speciesObservationList = GetPagedSpeciesObservationList(start, pageSize, null, bbox); var fieldDescriptionViewManager = new SpeciesObservationFieldDescriptionViewManager(UserContext, MySettings); var fieldDescriptionsViewModel = fieldDescriptionViewManager.CreateSpeciesObservationFieldDescriptionsViewModel(); SpeciesObservationsData speciesObservationsData = new SpeciesObservationsData(speciesObservationList, fieldDescriptionsViewModel); var viewManager = new SpeciesObservationTableViewManager(UserContext, MySettings); ViewTableViewModel viewModel = viewManager.CreateViewTableViewModel(); var speciesObservationDataManager = new SpeciesObservationDataManager(UserContext, MySettings); List <Dictionary <string, string> > dicResult = speciesObservationDataManager.GetObservationsDataList(speciesObservationsData.SpeciesObservationViewModels, viewModel.TableFields); return(dicResult); }
private SpeciesObservationsData CreateSpeciesObservationData(IUserContext userContext, AnalysisPortal.MySettings.MySettings mySettings) { SpeciesObservation speciesObservation = new SpeciesObservation(); speciesObservation.Taxon = new SpeciesObservationTaxon(); speciesObservation.Taxon.TaxonID = "1"; SpeciesObservationList speciesObservationList = new SpeciesObservationList(); speciesObservationList.Add(speciesObservation); var fieldDescriptionViewManager = new SpeciesObservationFieldDescriptionViewManager(userContext, mySettings); var fieldDescriptionsViewModel = fieldDescriptionViewManager.CreateSpeciesObservationFieldDescriptionsViewModel(); SpeciesObservationsData speciesObservationsData = new SpeciesObservationsData(speciesObservationList, fieldDescriptionsViewModel); return(speciesObservationsData); }
private static SpeciesObservationsData CreateSpeciesObservationDataSample() { SpeciesObservation speciesObservation; SpeciesObservationList speciesObservationList; SpeciesObservationsData speciesObservationsData; speciesObservation = new SpeciesObservation(); speciesObservation.Taxon = new SpeciesObservationTaxon(); speciesObservation.Taxon.TaxonID = "27"; speciesObservationList = new SpeciesObservationList(); speciesObservationList.Add(speciesObservation); var fieldDescriptionViewManager = new SpeciesObservationFieldDescriptionViewManager(SessionHandler.UserContext, SessionHandler.MySettings); var fieldDescriptionsViewModel = fieldDescriptionViewManager.CreateSpeciesObservationFieldDescriptionsViewModel(); speciesObservationsData = new SpeciesObservationsData(speciesObservationList, fieldDescriptionsViewModel); return(speciesObservationsData); }
public SpeciesObservationsData CalculateSpeciesObservations(CoordinateSystemId displayCoordinateSystemId) { var displayCoordinateSystem = new CoordinateSystem(displayCoordinateSystemId); var searchCriteriaManager = new SpeciesObservationSearchCriteriaManager(UserContext); var searchCriteria = searchCriteriaManager.CreateSearchCriteria(MySettings, displayCoordinateSystem); if (UserContext.CurrentRole.IsNull() && UserContext.CurrentRoles.Count > 0) { UserContext.CurrentRole = UserContext.CurrentRoles[0]; } var speciesObservationList = CoreData.SpeciesObservationManager.GetSpeciesObservations(UserContext, searchCriteria, displayCoordinateSystem); var fieldDescriptionViewManager = new SpeciesObservationFieldDescriptionViewManager(UserContext, MySettings); var fieldDescriptionsViewModel = fieldDescriptionViewManager.CreateSpeciesObservationFieldDescriptionsViewModel(); var speciesObservationsData = new SpeciesObservationsData(speciesObservationList, fieldDescriptionsViewModel); return(speciesObservationsData); }
public List <ResultObservationsListItem> GetTablePagedResultInBboxAsItems(int start, int pageSize, double bottom, double left, double right, double top) { Polygon bbox = GetPolygon(bottom, left, right, top); SpeciesObservationList speciesObservationList = GetPagedSpeciesObservationList(start, pageSize, null, bbox); var fieldDescriptionViewManager = new SpeciesObservationFieldDescriptionViewManager(UserContext, MySettings); var fieldDescriptionsViewModel = fieldDescriptionViewManager.CreateSpeciesObservationFieldDescriptionsViewModel(); SpeciesObservationsData speciesObservationsData = new SpeciesObservationsData(speciesObservationList, fieldDescriptionsViewModel); List <ResultObservationsListItem> list = new List <ResultObservationsListItem>(); foreach (SpeciesObservationViewModel speciesObservationViewModel in speciesObservationsData.SpeciesObservationViewModels) { list.Add(ResultObservationsListItem.Create(speciesObservationViewModel)); } return(list); //speciesObservationsData.SpeciesObservationViewModels //var viewManager = new SpeciesObservationTableViewManager(UserContext, MySettings); //ViewTableViewModel viewModel = viewManager.CreateViewTableViewModel(); //var speciesObservationDataManager = new SpeciesObservationDataManager(UserContext, MySettings); //List<Dictionary<string, string>> dicResult = speciesObservationDataManager.GetObservationsDataList(speciesObservationsData.SpeciesObservationViewModels, viewModel.TableFields); //return dicResult; }