Пример #1
0
        public void CellValueChanged(object sender, DevExpress.XtraSpreadsheet.SpreadsheetCellEventArgs e)
        {
            if (!AllowChangeOrder())
            {
                return;
            }
            string reference     = e.Cell.GetReferenceA1();
            var    oldCustomerId = order.CustomerId;
            string shiftedRange  = CellsHelper.GetActualCellRange(reference, actualOrderItems.Any() ? -actualOrderItems.Count : 0);

            if (OrderPropertiesHelper.Setters.ContainsKey(shiftedRange))
            {
                OrderPropertiesHelper.Setters[shiftedRange].Invoke(order, e.Cell.Value, source);
                if (CellsHelper.HasDependentCells(shiftedRange))
                {
                    if (order.CustomerId != oldCustomerId)
                    {
                        UpdateCustomerStores();
                    }
                    CellsHelper.UpdateDependentCells(Invoice, order, source);
                    UpdateTotalValues();
                }
            }
            if (IsOrderItemsRegionModified(e.Cell))
            {
                UpdateOrderItem(e.Cell);
            }
        }
Пример #2
0
        public static CellValue GetOrderCellValue(CellsKind cell, List <OrderItem> orderItems, Worksheet invoice)
        {
            var range = CellsHelper.GetActualCellRange(CellsHelper.FindLeftCell(cell), orderItems.Any() ? orderItems.Count : 0);

            return(invoice.Cells[range].Value);
        }