public WindowBase(Session session) { InitializeComponent(); #region Initialize _session = session; WindowState = WindowState.Maximized; //ThemeManager.SetThemeName(this, "Office2007Blue"); //ThemeManager.SetThemeName(this, "Office2007Black"); //ThemeManager.SetThemeName(this, "LightGray"); ThemeManager.SetThemeName(this, "DeepBlue"); _session.GetDocument().DocProjected += DbDocProjected; // ??? Closing += WindowBaseClosing; #endregion #region Initialize Background Worker _worker = new BackgroundWorker(); _worker.DoWork += WorkerDoWork; _worker.RunWorkerCompleted += WorkerRunWorkerCompleted; _worker.ProgressChanged += WorkerProgressChanged; #endregion #region Initialize PivotGrid Control _pivotGridControl1.DataSource = _session.GetTableData(Table.TableBaseSource); _pivotGridControl1.HiddenFieldList += PivotGridControl1HiddenFieldList; List<Column> columns; try { columns = _session.GetTableColumns(Table.TableSecSource); } catch (AssortmentException ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); return; } _pivotGridControl1.InitializeControl(columns, FormTypes.Base); _pivotGridControl1.Fields["LOC"].Area = FieldArea.ColumnArea; _pivotGridControl1.Fields["LOC"].Visible = true; _pivotGridControl1.Fields["ITEM"].Area = FieldArea.RowArea; _pivotGridControl1.Fields["ITEM"].Visible = true; _pivotGridControl1.Fields["MEASURE_STATUS_NEW"].Area = FieldArea.DataArea; _pivotGridControl1.Fields["MEASURE_STATUS_NEW"].Visible = true; _pivotGridControl1.ShowRowTotals = false; _pivotGridControl1.ShowColumnTotals = false; #endregion }
public WindowSecondary(Session session, PivotGridControlModified control = null, bool isWhRestExistsCheckErrorDoc = false) { InitializeComponent(); #region Initialize _session = session; _closeWithoutCheck = false; ThemeManager.SetThemeName(this, "DeepBlue"); WindowState = WindowState.Maximized; _session.GetDocument().DocProjected += DbDocProjected; // ??? Closing += WindowSecondaryClosing; _pivotGridControl2.CellClickAction += PivotGridControl2CellClickModified; Title = _session.GetTitle(); #endregion #region Initialize PivotGrid Control _pivotGridControl2.DataSource = _session.GetTableData(Table.TableSecSource); _pivotGridControl2.HiddenFieldList += PivotGridControl2HiddenFieldList; _pivotGridControl2.FieldFilterChanged += _pivotGridControl2FieldFilterChanged; List<Column> columns; try { columns = _session.GetTableColumns(Table.TableSecSource); } catch (AssortmentException ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); return; } _pivotGridControl2.InitializeControl(columns, FormTypes.Secondary); if (isWhRestExistsCheckErrorDoc) { _pivotGridControl2.Fields["LOC"].Area = FieldArea.ColumnArea; _pivotGridControl2.Fields["LOC"].Visible = true; _pivotGridControl2.Fields["ITEM"].Area = FieldArea.RowArea; _pivotGridControl2.Fields["ITEM"].Visible = true; _pivotGridControl2.Fields["MEASURE_STATUS_NEW"].Area = FieldArea.DataArea; _pivotGridControl2.Fields["MEASURE_STATUS_NEW"].Visible = true; _pivotGridControl2.SetFiltersForWhRestExistsCheckErrorDoc(); } if (control == null) _pivotGridControl2.SetLayout(_session.GetDocument().PivotLayout); else _pivotGridControl2.CopyLayout(control); _pivotGridControl2.ShowRowTotals = false; _pivotGridControl2.ShowColumnTotals = false; #endregion }