private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "ChartSettings":

                CWChartSettings cwChartSettingDialog = new CWChartSettings(pivotDgProjectPlanning.ChartSelectionOnly, pivotDgProjectPlanning.ChartProvideColumnGrandTotals,
                                                                           pivotDgProjectPlanning.ChartProvideRowGrandTotals, labelVisibility, seriesIndex, pivotDgProjectPlanning.ChartProvideDataByColumns, chartEnable);
                cwChartSettingDialog.Closed += delegate
                {
                    if (cwChartSettingDialog.DialogResult == true)
                    {
                        if (cwChartSettingDialog.IsChartVisible)
                        {
                            chartControl.Diagram = cwChartSettingDialog.ChartDaigram;
                            pivotDgProjectPlanning.ChartProvideEmptyCells        = IsPivotTableProvideEmptyCells();
                            chartControl.Diagram.SeriesTemplate.LabelsVisibility = cwChartSettingDialog.labelVisibility;
                            chartControl.CrosshairEnabled = cwChartSettingDialog.crossHairEnabled;
                            pivotDgProjectPlanning.ChartProvideDataByColumns     = cwChartSettingDialog.chartProvideDataByColumns;
                            pivotDgProjectPlanning.ChartSelectionOnly            = cwChartSettingDialog.ChartSelectionOnly;
                            pivotDgProjectPlanning.ChartProvideColumnGrandTotals = cwChartSettingDialog.ChartProvideColumnGrandTotals;
                            pivotDgProjectPlanning.ChartProvideRowGrandTotals    = cwChartSettingDialog.ChartProvideRowGrandTotals;
                            seriesIndex             = cwChartSettingDialog.SeriesIndex;
                            chartControl.Visibility = Visibility.Visible;
                            if (rowgridSplitter.Height.Value == 0 && rowChartControl.Height.Value == 0)
                            {
                                rowgridSplitter.Height = new GridLength(5);
                                var converter = new GridLengthConverter();
                                rowChartControl.Height = (GridLength)converter.ConvertFrom("Auto");
                            }
                        }
                        else
                        {
                            chartControl.Visibility = Visibility.Collapsed;
                            rowgridSplitter.Height  = new GridLength(0);
                            rowChartControl.Height  = new GridLength(0);
                        }
                        chartEnable     = cwChartSettingDialog.IsChartVisible;
                        labelVisibility = cwChartSettingDialog.labelVisibility;
                    }
                };
                cwChartSettingDialog.Show();
                break;

            case "ImportPivotTableLayout":
                controlRibbon_BaseActions(ActionType);
                if (chartControl.Diagram != null)
                {
                    chartControl.Visibility = Visibility.Visible;
                    labelVisibility         = chartControl.Diagram.SeriesTemplate.LabelsVisibility;
                    seriesIndex             = GetSeriesId();
                }
                break;

            default:
                controlRibbon_BaseActions(ActionType);
                break;
            }
        }
Beispiel #2
0
        private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "RefreshGrid":
                BindGrid(true);
                pivotDgInvTrans.RefreshData();
                break;

            case "LocalFilter":
                if (filterDialog == null)
                {
                    if (filterCleared)
                    {
                        filterDialog = new CWServerFilter(api, typeof(InvTransClient), null, null, UserFields);
                    }
                    else
                    {
                        filterDialog = new CWServerFilter(api, typeof(InvTransClient), null, null, UserFields);
                    }
                    filterDialog.Closing += filterDialog_Closing;
                    filterDialog.Show();
                }
                else
                {
                    filterDialog.Show(true);
                }
                break;

            case "ClearLocalFilter":
                filterDialog  = null;
                filterValues  = null;
                filterCleared = true;
                BindGrid();
                pivotDgInvTrans.RefreshData();
                break;

            case "ChartSettings":
                CWChartSettings cwChartSettingDialog = new CWChartSettings(pivotDgInvTrans.ChartSelectionOnly, pivotDgInvTrans.ChartProvideColumnGrandTotals,
                                                                           pivotDgInvTrans.ChartProvideRowGrandTotals, labelVisibility, seriesIndex, pivotDgInvTrans.ChartProvideDataByColumns, chartEnable);
                cwChartSettingDialog.Closed += delegate
                {
                    if (cwChartSettingDialog.DialogResult == true)
                    {
                        if (cwChartSettingDialog.IsChartVisible)
                        {
                            chartControl.Diagram = cwChartSettingDialog.ChartDaigram;
                            pivotDgInvTrans.ChartProvideEmptyCells = IsPivotTableProvideEmptyCells();
                            chartControl.Diagram.SeriesTemplate.LabelsVisibility = cwChartSettingDialog.labelVisibility;
                            chartControl.CrosshairEnabled                 = cwChartSettingDialog.crossHairEnabled;
                            pivotDgInvTrans.ChartProvideDataByColumns     = cwChartSettingDialog.chartProvideDataByColumns;
                            pivotDgInvTrans.ChartSelectionOnly            = cwChartSettingDialog.ChartSelectionOnly;
                            pivotDgInvTrans.ChartProvideColumnGrandTotals = cwChartSettingDialog.ChartProvideColumnGrandTotals;
                            pivotDgInvTrans.ChartProvideRowGrandTotals    = cwChartSettingDialog.ChartProvideRowGrandTotals;
                            seriesIndex             = cwChartSettingDialog.SeriesIndex;
                            chartControl.Visibility = Visibility.Visible;
                            if (rowgridSplitter.Height.Value == 0 && rowChartControl.Height.Value == 0)
                            {
                                rowgridSplitter.Height = new GridLength(5);
                                var converter = new GridLengthConverter();
                                rowChartControl.Height = (GridLength)converter.ConvertFrom("Auto");
                            }
                        }
                        else
                        {
                            chartControl.Visibility = Visibility.Collapsed;
                            rowgridSplitter.Height  = new GridLength(0);
                            rowChartControl.Height  = new GridLength(0);
                        }
                        chartEnable     = cwChartSettingDialog.IsChartVisible;
                        labelVisibility = cwChartSettingDialog.labelVisibility;
                    }
                };
                cwChartSettingDialog.Show();
                break;

            case "ImportPivotTableLayout":
                controlRibbon_BaseActions(ActionType);
                if (chartControl.Diagram != null)
                {
                    chartControl.Visibility = Visibility.Visible;
                    labelVisibility         = chartControl.Diagram.SeriesTemplate.LabelsVisibility;
                    seriesIndex             = GetSeriesId();
                }
                break;

            default:
                controlRibbon_BaseActions(ActionType);
                break;
            }
        }
        private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "Search":
                BtnSearch();

                break;

            case "RefreshGrid":
                BtnSearch();
                break;

            case "ChartSettings":

                CWChartSettings cwChartSettingDialog = new CWChartSettings(pivotDgProjectPlanning.ChartSelectionOnly, pivotDgProjectPlanning.ChartProvideColumnGrandTotals,
                                                                           pivotDgProjectPlanning.ChartProvideRowGrandTotals, labelVisibility, seriesIndex, pivotDgProjectPlanning.ChartProvideDataByColumns, chartEnable);
                cwChartSettingDialog.Closed += delegate
                {
                    if (cwChartSettingDialog.DialogResult == true)
                    {
                        if (cwChartSettingDialog.IsChartVisible)
                        {
                            chartControl.Diagram = cwChartSettingDialog.ChartDaigram;
                            pivotDgProjectPlanning.ChartProvideEmptyCells        = IsPivotTableProvideEmptyCells();
                            chartControl.Diagram.SeriesTemplate.LabelsVisibility = cwChartSettingDialog.labelVisibility;
                            chartControl.CrosshairEnabled = cwChartSettingDialog.crossHairEnabled;
                            pivotDgProjectPlanning.ChartProvideDataByColumns     = cwChartSettingDialog.chartProvideDataByColumns;
                            pivotDgProjectPlanning.ChartSelectionOnly            = cwChartSettingDialog.ChartSelectionOnly;
                            pivotDgProjectPlanning.ChartProvideColumnGrandTotals = cwChartSettingDialog.ChartProvideColumnGrandTotals;
                            pivotDgProjectPlanning.ChartProvideRowGrandTotals    = cwChartSettingDialog.ChartProvideRowGrandTotals;
                            chartControl.Visibility = Visibility.Visible;
                            if (rowgridSplitter.Height.Value == 0 && rowChartControl.Height.Value == 0)
                            {
                                rowgridSplitter.Height = new GridLength(5);
                                var converter = new GridLengthConverter();
                                rowChartControl.Height = (GridLength)converter.ConvertFrom("Auto");
                            }
                        }
                        else
                        {
                            chartControl.Visibility = Visibility.Collapsed;
                            rowgridSplitter.Height  = new GridLength(0);
                            rowChartControl.Height  = new GridLength(0);
                        }
                        chartEnable     = cwChartSettingDialog.IsChartVisible;
                        labelVisibility = cwChartSettingDialog.labelVisibility;
                    }
                };
                cwChartSettingDialog.Show();
                break;

            case "Lines":
                if (selectedCellRow != null && selectedCellColumnFields != null)
                {
                    OpenBudgetTransactions(selectedCellColumnFields, selectedCellRow);
                }
                break;

            case "Check":
                AddDockItem(TabControls.TMPlanningCheckPage, null);
                break;

            case "ImportPivotTableLayout":
            case "LoadSavedLayout":
                controlRibbon_BaseActions(ActionType);
                pivotDgProjectPlanning.Visibility = Visibility.Visible;
                break;

            default:
                controlRibbon_BaseActions(ActionType);
                break;
            }
        }