コード例 #1
0
        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
        }
コード例 #2
0
        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
        }
コード例 #3
0
        //private readonly PivotGridControlModified _pivotGridControl1;
        //private readonly Document _doc;

        //public WindowRegister(Object dbObject, Object pivotGridControl, Document doc)
        public WindowRegister(Session session)
        {
            InitializeComponent();

            Width = 880;
            Height = 720;

            _session = session;

            //_pivotGridControl1 = (PivotGridControlModified)pivotGridControl;
            //_db = (DBManager)dbObject;
            //_doc = doc;

            #region Initialize Background Worker

            _worker = new BackgroundWorker();
            _worker.DoWork += WorkerDoWork;
            _worker.RunWorkerCompleted += WorkerRunWorkerCompleted;
            _worker.ProgressChanged += WorkerProgressChanged;

            #endregion

            #region Initialize Control

            try
            {
                _session.FillRegister();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                throw;
            }

            gridControl1.DataSource = _session.GetTableData(Table.TableRegister);

            gridControl1.Columns.Add(new GridColumn { FieldName = "ID", Header = "Номер", AllowEditing = DefaultBoolean.False, AllowBestFit = DefaultBoolean.True, Visible = true });
            gridControl1.Columns.Add(new GridColumn { FieldName = "ID_USER", Header = "Пользователь", AllowEditing = DefaultBoolean.False, AllowBestFit = DefaultBoolean.True, CellTemplate = (DataTemplate)FindResource("RowTemplate") });
            gridControl1.Columns.Add(new GridColumn { FieldName = "CREATE_TIME", Header = "Дата создания", AllowEditing = DefaultBoolean.False, AllowBestFit = DefaultBoolean.True, CellTemplate = (DataTemplate)FindResource("RowTemplate") });
            gridControl1.Columns.Add(new GridColumn { FieldName = "ROW_COUNT", Header = "Количество строк", AllowEditing = DefaultBoolean.False, AllowBestFit = DefaultBoolean.True, CellTemplate = (DataTemplate)FindResource("RowTemplate") });
            gridControl1.Columns.Add(new GridColumn { FieldName = "STATUS", Header = "Статус", AllowEditing = DefaultBoolean.False, AllowBestFit = DefaultBoolean.True, CellTemplate = (DataTemplate)FindResource("RowTemplate") });
            gridControl1.Columns.Add(new GridColumn { FieldName = "DOC_TYPE", Header = "Тип", AllowEditing = DefaultBoolean.False, AllowBestFit = DefaultBoolean.True, CellTemplate = (DataTemplate)FindResource("RowTemplate") });
            gridControl1.Columns.Add(new GridColumn { FieldName = "LAST_UPDATE_TIME", Header = "Дата обновления", AllowEditing = DefaultBoolean.False, AllowBestFit = DefaultBoolean.True, CellTemplate = (DataTemplate)FindResource("RowTemplate") });
            gridControl1.Columns.Add(new GridColumn { FieldName = "DESCRIPTION", Header = "Комментарий", AllowEditing = DefaultBoolean.False, AllowBestFit = DefaultBoolean.True, CellTemplate = (DataTemplate)FindResource("RowTemplate") });

            gridControl1.SortBy(gridControl1.Columns["ID"]);

            gridControl1.MouseDoubleClick += GridControl1MouseDoubleClick;
            gridControl1.MouseRightButtonDown += GridControl1MouseRightButtonDown;

            //gridControl1.View.GroupRowTemplate = (DataTemplate)FindResource("RowTemplate");

            #endregion
        }