Example #1
0
        int PopulateInvoiceGoodsList()
        {
            int       goodsCount   = 0;
            Worksheet currentSheet = Workbook.Worksheets[0];

            for (int i = 0; i < invoiceGoods.Count; ++i)
            {
                if (invoiceGoods[i].Quantity > 0)
                {
                    int currentRowIndex      = goodsStartRow + goodsCount;
                    Row currentRow           = currentSheet.Rows[currentRowIndex];
                    InvoiceInMemoryData item = invoiceGoods[i];
                    currentRow[1].Value = item.ProductName;
                    currentRow[2].Value = item.Quantity;
                    currentRow[3].Value = item.Price;
                    currentRow[4].Value = item.Discount;
                    if ((goodsCount % 2) != 0)
                    {
                        SetRangeFillColor(currentSheet.Range.FromLTRB(1, currentRowIndex, 5, currentRowIndex), goodsEvenColor);
                    }
                    ++goodsCount;
                    if (goodsCount >= maxItemsInInvoice)
                    {
                        break;
                    }
                }
            }
            return(goodsCount);
        }
Example #2
0
 public void AddGoods(InvoiceInMemoryData value)
 {
     invoiceGoods.Add(value);
 }