Exemplo n.º 1
0
        void SetDefaultCustomerStore()
        {
            var store = source.CustomerStores.First();

            OrderPropertiesHelper.UpdateCustomerStoreIfNeeded(order, store.City, source);
            Invoice.Cells[CellsHelper.FindLeftCell(CellsKind.CustomerStoreName)].Value = store.City;
        }
Exemplo n.º 2
0
        void UpdateOrderItem(Cell cell)
        {
            var   verticalOffset  = GetOrderItemOffset(cell);
            Range orderItemsRange = GetOrderItemsArea().Range;

            var orderItem      = actualOrderItems[verticalOffset];
            var orderItemRange = Invoice.Range.FromLTRB(orderItemsRange.LeftColumnIndex, orderItemsRange.TopRowIndex + verticalOffset,
                                                        orderItemsRange.RightColumnIndex, orderItemsRange.TopRowIndex + verticalOffset);

            OrderPropertiesHelper.UpdateProductUnits(orderItem, orderItemRange, Invoice);
            OrderPropertiesHelper.UpdateProduct(orderItem, CellsHelper.GetOrderItemCellValue(CellsKind.ProductDescription, orderItemRange, Invoice), source);
            OrderPropertiesHelper.UpdateProductPrice(cell, orderItem, orderItemRange);
            AsyncUpdateSummaries(orderItem, orderItemRange);
        }
Exemplo n.º 3
0
        void AddOrderItemToSheet(OrderItem orderItem)
        {
            var invoiceItemsArea = GetOrderItemsArea();
            int rowIndex         = invoiceItemsArea.Range.BottomRowIndex;

            Invoice.Rows.Insert(rowIndex);
            Invoice.Rows[rowIndex].Height     = Invoice.Rows[rowIndex - 1].Height;
            Invoice.Rows[rowIndex + 1].Height = Invoice.Rows[rowIndex].Height;
            DevExpress.Spreadsheet.Range range     = invoiceItemsArea.Range;
            DevExpress.Spreadsheet.Range itemRange = Invoice.Range.FromLTRB(range.LeftColumnIndex, range.BottomRowIndex, range.RightColumnIndex, range.BottomRowIndex);
            if (range.RowCount == 1)
            {
                Invoice["K24"].FormulaInvariant = "=SUM(K22:K23)";
                invoiceItemsArea.Range          = Invoice.Range.FromLTRB(range.LeftColumnIndex, range.TopRowIndex - 1, range.RightColumnIndex, range.BottomRowIndex)
                                                  .GetRangeWithAbsoluteReference();
                if (AllowChangeOrder())
                {
                    UpdateOrderItemEditors();
                }
            }
            CellsHelper.CopyOrderItemRange(itemRange);
            OrderPropertiesHelper.InitializeOrderItem(itemRange, orderItem);
        }