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); }
public static void CreateCollectionEditor <T>(CellsKind cell, Worksheet invoice, IEnumerable <T> source, Func <T, string> getValue) { var cellInfo = FindCell(cell); var cellValues = source.Select(x => CellValue.FromObject(getValue(x))).ToArray(); invoice.CustomCellInplaceEditors.Add(invoice[cellInfo.CellRange], cellInfo.EditorType.Value, ValueObject.CreateListSource(cellValues)); }
public OrderCellInfo(CellsKind cell, string cellRange, CustomCellInplaceEditorType?editorType = null, string editorId = null, CellValue[] fixedValues = null, int?offset = null, bool hasDependentCells = false) { Cell = cell; CellRange = cellRange; EditorType = editorType; EditorId = editorId; FixedValues = fixedValues; Offset = offset; HasDependentCells = hasDependentCells; }
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); }
public static void RemoveEditor(CellsKind cell, Worksheet invoice) { var storeCell = FindCell(cell); invoice.CustomCellInplaceEditors.Remove(invoice[storeCell.CellRange]); }
public static int GetOffset(CellsKind kind) { return(FindCell(kind).Offset.Value); }
public static string FindLeftCell(CellsKind cell) { return(FindLeftCell(cellsPosition[cell])); }
public static OrderCellInfo FindCell(CellsKind cell) { return(OrderCells.FirstOrDefault(x => x.Cell == cell) ?? OrderItemCells.FirstOrDefault(x => x.Cell == cell)); }