/// <inheritdoc/>
        public void AttachExtraPresenters(CLEMPresenter clemPresenter)
        {
            try
            {
                // Create the grid to display data in
                gridView = new GridView(clemPresenter.view as ViewBase);
                GridPresenter gridPresenter = new GridPresenter();

                // Generate the table using the model
                pivot = clemPresenter.clemModel as ReportPivot;
                gridView.DataSource = pivot.GenerateTable();
                gridPresenter.Attach(null, gridView, clemPresenter.explorerPresenter);

                // Attach the view to display data

                clem = clemPresenter.view as CLEMView;
                clem.AddTabView("Data", gridView);
                clemPresenter.presenterList.Add("Data", this);

                //clem.TabSelected += Refresh;
            }
            catch (Exception err)
            {
                clemPresenter.explorerPresenter.MainPresenter.ShowError(err);
            }
        }
Exemple #2
0
        /// <inheritdoc/>
        public void AttachExtraPresenters(CLEMPresenter clemPresenter)
        {
            try
            {
                // Create the grid to display data in
                gridView = new GridView(clemPresenter.View as ViewBase);
                GridPresenter gridPresenter = new GridPresenter();

                // Create the SQL display
                sqlView = new TextInputView(clemPresenter.View as ViewBase);

                // Generate the table using the model
                pivot = clemPresenter.ClemModel as ReportPivot;
                gridPresenter.Attach(null, gridView, clemPresenter.ExplorerPresenter);

                // Attach the views to display data
                clem = clemPresenter.View as CLEMView;

                clem.AddTabView("Data", gridView);
                clemPresenter.PresenterList.Add("Data", this);

                clem.AddTabView("SQL", sqlView);
                clemPresenter.PresenterList.Add("SQL", this);
            }
            catch (Exception err)
            {
                clemPresenter.ExplorerPresenter.MainPresenter.ShowError(err);
            }
        }
Exemple #3
0
        protected void LayoutItemsCombo_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            var x = XElement.Parse(e.Parameter);

            switch (x.ValueOf("action"))
            {
            case "save":
            {
                var P      = new ReportPivot();
                var Layout = ReportPivotGird.SaveLayoutToString();

                P.TSP_ReportPivotLayouts(iud: 0, Caption: x.ValueOf("caption"), Layout: ReportPivotGird.SaveLayoutToString());
                if (P.IsError)
                {
                    throw new Exception(Cavea.Core.Properties.Resources.Abort);
                }
                else
                {
                    LayoutItemsDataSource.CacheDuration = 0;
                    LayoutItemsCombo.DataBind();
                    LayoutItemsDataSource.CacheDuration = 3600;
                }
                break;
            }

            case "delete":
            {
                var P = new ReportPivot();
                P.TSP_ReportPivotLayouts(iud: 2, ID: x.IntValueOf("id"));
                if (P.IsError)
                {
                    throw new Exception(Cavea.Core.Properties.Resources.Abort);
                }
                else
                {
                    LayoutItemsDataSource.CacheDuration = 0;
                    LayoutItemsCombo.DataBind();
                    LayoutItemsDataSource.CacheDuration = 3600;
                }

                break;
            }

            case "databind":
            {
                LayoutItemsCombo.DataBind();
                break;
            }
            }
        }