public static void InitializeOrderItem(DevExpress.Spreadsheet.Range itemRange, OrderItem orderItem)
 {
     itemRange[CellsHelper.GetOffset(CellsKind.ProductDescription)].Value = orderItem.Product != null
         ? orderItem.Product.Name : string.Empty;
     itemRange[CellsHelper.GetOffset(CellsKind.Quantity)].Value  = orderItem.ProductUnits > 0 ? orderItem.ProductUnits : 1;
     itemRange[CellsHelper.GetOffset(CellsKind.UnitPrice)].Value = (double)orderItem.ProductPrice;
     itemRange[CellsHelper.GetOffset(CellsKind.Discount)].Value  = (double)orderItem.Discount;
 }
 public static void UpdateProductPrice(Cell cell, OrderItem orderItem, DevExpress.Spreadsheet.Range orderItemRange)
 {
     if (CellsHelper.IsOrderItemProductCell(cell, orderItemRange))
     {
         orderItemRange[CellsHelper.GetOffset(CellsKind.UnitPrice)].Value = (double)orderItem.Product.SalePrice;
         orderItem.ProductPrice = orderItem.Product.SalePrice;
     }
 }
Пример #3
0
        public static CellValue GetOrderItemCellValue(CellsKind cell, Range orderItemRange, Worksheet invoice)
        {
            int offset    = CellsHelper.GetOffset(cell);
            var cellRange = invoice.Range.FromLTRB(orderItemRange.LeftColumnIndex + offset,
                                                   orderItemRange.TopRowIndex, orderItemRange.LeftColumnIndex + offset, orderItemRange.BottomRowIndex);

            return(cellRange.Value);
        }