Exemplo n.º 1
0
 public Session(string login, string password, OperationModes data, OperationModes database)
 {
     _db = new DBManager();
     _merch = new Merchant(login, password);
     _doc = new Document(_db, null);
     _database = database;
     _data = data;
 }
        public WindowDescription(Document document)
        {
            InitializeComponent();

            KeyDown += WindowDescriptionKeyDown;

            _doc = document;
            textBox1.Text = _doc.Description;
            textBox1.Focus();
            textBox1.SelectAll();
        }
Exemplo n.º 3
0
 public void CreateDocument(string docType)
 {
     _doc = new Document(_db, docType);
 }
        public WindowRowOriented(Session session, PivotGridControl pivotGridControl1)
        {
            InitializeComponent();

            #region Initialize

            _session = session;
            _closeWithoutCheck = false;
            _db = _session.GetDbManager();
            _doc = _session.GetDocument();
            //ThemeManager.SetThemeName(this, "Office2007Silver");
            ThemeManager.SetThemeName(this, "DeepBlue");
            WindowState = WindowState.Maximized;
            Closing += WindowSecondaryClosing;
            _doc.DocProjected += DbDocProjected;
            var desc = _doc.Description;
            Title = "Документ: " + (desc ?? "не создан") + " (" + _doc.Id + ", " + DocTypes.Description(_doc.DocType) + ")";
            //Title = "Документ: " + (desc.Equals("") ? "не создан" : desc) + " (" + _doc.Id + ", " + (_doc.DocType == DocTypes.Operative ? "Оперативный" : "Обычный") + ")";

            try
            {
                _db.FillDataTableCustom(Table.TableSupplier.Name, Table.TableSupplier.SelectClause, Table.TableSupplier.KeyFields, false);
            }
            catch (AssortmentException ex)
            {
                MessageBox.Show(Table.TableSupplier + ": " + ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
/*
            if (_db.FillDataTableCustom(Table.TableSupplier.Name, Table.TableSupplier.SelectClause, Table.TableSupplier.KeyFields, false) == false)
            {
                MessageBox.Show("Ошибка при формировании источника: " + _db.Error, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
            }
*/
            #endregion

            #region Initialize PivotGrid Control

            try
            {
                _db.FillDataTableCustom(Table.TableRowSource);
            }
            catch (AssortmentException ex)
            {
                MessageBox.Show(Table.TableRowSource + ": " + ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
/*
            if (_db.FillDataTableCustom(Table.TableRowSource) == false)
            {
                MessageBox.Show("Ошибка при формировании источника: " + _db.Error, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
            }
*/
            _pivotGridControl2.DataSource = _db.DataTableGet(Table.TableRowSource.Name).DefaultView;
            _pivotGridControl2.HiddenFieldList += PivotGridControl2HiddenFieldList;

            var dimensions = _db.GetTableDefinition(Table.TableRowSource.DBName);

            if (dimensions == null)
            {
                MessageBox.Show("Список измерений для данной таблицы пуст", "Ошибка", MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }
            else
            {
                _pivotGridControl2.InitializeControl(dimensions, _db);
            }

            _pivotGridControl2.InitializeLayout(pivotGridControl1);

            _pivotGridControl2.ShowRowTotals = false;
            _pivotGridControl2.ShowColumnTotals = false;
            _pivotGridControl2.ShowColumnGrandTotals = false;
            _pivotGridControl2.ShowRowGrandTotals = false;

            _pivotGridControl2.CellClickInputData += PivotGridControl2CellClickInputData;

            _pivotGridControl2.BestFit();

            #endregion
        }