예제 #1
0
        /// <summary>Get data to show in grid.</summary>
        /// <returns>A data table of all data.</returns>
        private DataTable GetData()
        {
            DataTable data;

            if (dataStore != null)
            {
                int start = 0;
                int count = Utility.Configuration.Settings.MaximumRowsOnReportGrid;
                if (ExperimentFilter != null)
                {
                    string filter = "NAME IN " + "(" + StringUtilities.Build(ExperimentFilter.GetSimulationNames(), delimiter: ",", prefix: "'", suffix: "'") + ")";
                    data = dataStore.GetData(tableName: view.TableList.SelectedValue, filter: filter, from: start, count: count);
                }
                else if (SimulationFilter != null)
                {
                    data = dataStore.GetData(simulationName: SimulationFilter.Name,
                                             tableName: view.TableList.SelectedValue,
                                             from: start, count: count);
                }
                else
                {
                    data = dataStore.GetData(tableName: view.TableList.SelectedValue,
                                             count: Utility.Configuration.Settings.MaximumRowsOnReportGrid);
                }
            }
            else
            {
                data = new DataTable();
            }
            return(data);
        }
예제 #2
0
        /// <summary>Get data to show in grid.</summary>
        /// <returns>A data table of all data.</returns>
        private DataTable GetData()
        {
            DataTable data = null;

            if (dataStore != null)
            {
                try
                {
                    int start = 0;
                    int count = Utility.Configuration.Settings.MaximumRowsOnReportGrid;
                    if (ExperimentFilter != null)
                    {
                        string filter = "S.NAME IN " + "(" + StringUtilities.Build(ExperimentFilter.GetSimulationNames(), delimiter: ",", prefix: "'", suffix: "'") + ")";
                        if (!string.IsNullOrEmpty(view.RowFilter.Value))
                        {
                            filter += " AND " + view.RowFilter.Value;
                        }
                        data = dataStore.GetData(tableName: view.TableList.SelectedValue, filter: filter, from: start, count: count);
                    }
                    else if (SimulationFilter != null)
                    {
                        data = dataStore.GetData(
                            simulationName: SimulationFilter.Name,
                            tableName: view.TableList.SelectedValue,
                            from: start,
                            count: count);
                    }
                    else
                    {
                        data = dataStore.GetData(
                            tableName: view.TableList.SelectedValue,
                            count: Utility.Configuration.Settings.MaximumRowsOnReportGrid);
                    }
                }
                catch (Exception e)
                {
                    this.explorerPresenter.MainPresenter.ShowError(new Exception("Error reading data tables.", e));
                }
            }
            else
            {
                data = new DataTable();
            }

            return(data);
        }
예제 #3
0
        /// <summary>Get data to show in grid.</summary>
        /// <returns>A data table of all data.</returns>
        private DataTable GetData()
        {
            DataTable data = null;

            if (dataStore != null)
            {
                try
                {
                    int start = 0;
                    int count = Utility.Configuration.Settings.MaximumRowsOnReportGrid;
                    if (ExperimentFilter != null)
                    {
                        string filter = "NAME IN " + "(" + StringUtilities.Build(ExperimentFilter.GetSimulationNames(), delimiter: ",", prefix: "'", suffix: "'") + ")";
                        data = dataStore.GetData(tableName: view.TableList.SelectedValue, filter: filter, from: start, count: count);
                    }
                    else if (SimulationFilter != null)
                    {
                        data = dataStore.GetData(
                            simulationName: SimulationFilter.Name,
                            tableName: view.TableList.SelectedValue,
                            from: start,
                            count: count);
                    }
                    else
                    {
                        data = dataStore.GetData(
                            tableName: view.TableList.SelectedValue,
                            count: Utility.Configuration.Settings.MaximumRowsOnReportGrid);
                    }
                }
                catch (Exception e)
                {
                    this.explorerPresenter.MainPresenter.ShowMessage("Error reading data tables." + Environment.NewLine + e.ToString(), Simulation.ErrorLevel.Error);
                }
            }
            else
            {
                data = new DataTable();
            }

            return(data);
        }