Exemplo n.º 1
0
        private static void AddLineItems(ref PdfPTable table, ref Claim claim, bool printAmount)
        {
            PdfPTable information = new PdfPTable(new float[] {5, 15, 40, 20, 20, 20});
            information.AddCell(CreateLineItemHeaderCell("#"));
            information.AddCell(CreateLineItemHeaderCell("Type"));
            information.AddCell(CreateLineItemHeaderCell("Component"));
            information.AddCell(CreateLineItemHeaderCell("Labor Rate"));
            information.AddCell(CreateLineItemHeaderCell("Paid Hours"));
            information.AddCell(CreateLineItemHeaderCell("Paid Amount"));

            int lineItemNumber = 1;
            foreach (ClaimLineItem item in claim.GetLineItems(true))
            {
                information.AddCell(CreateNormalCell(Convert.ToString(lineItemNumber)));
                information.AddCell(CreateNormalCell(item.Type));
                information.AddCell(CreateNormalCell(item.Component));
                information.AddCell(CreateNormalCell(item.IsLaborItem ? String.Format("{0:C}/hour", printAmount ? item.HourlyLaborRate : 0.0m) : ""));
                information.AddCell(CreateNormalCell(item.IsLaborItem ? String.Format("{0:0.00}", printAmount ? item.Hours : 0.00) : ""));
                information.AddCell(CreateNormalCell(String.Format("{0:C}", printAmount ? item.Amount : 0.0m)));
                lineItemNumber++;
            }

            table.AddCell(CreateBigCell(information));
        }