private void AddTableRow(Table saccoPaymentsTable, saccorepayment tr)
        {
            if (tr != null)
            {
                //Totals

                Cell B = new Cell(new Phrase(tr.employeenumber, tcFont));
                B.HorizontalAlignment = Cell.ALIGN_LEFT;
                saccoPaymentsTable.AddCell(B);//Col 2

                Cell C = new Cell(new Phrase(tr.employeename, tcFont));
                C.HorizontalAlignment = Cell.ALIGN_LEFT;
                saccoPaymentsTable.AddCell(C);//Col 3

                Cell G = new Cell(new Phrase(tr.SaccoDescription, tcFont));
                G.HorizontalAlignment = Cell.ALIGN_LEFT;
                saccoPaymentsTable.AddCell(G);//Col 2

                Cell D = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", tr.monthamount), tcFont));
                D.HorizontalAlignment = Cell.ALIGN_RIGHT;
                saccoPaymentsTable.AddCell(D);//Col 2

                Cell E = new Cell(new Phrase(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:N0}", tr.ytdamt), tcFont));
                E.HorizontalAlignment = Cell.ALIGN_RIGHT;
                saccoPaymentsTable.AddCell(E);//Col 2
            }
        }
예제 #2
0
        private List <saccorepayment> GetSaccoRePayments()
        {
            try
            {
                List <saccorepayment> saccorepayment = new List <saccorepayment>();

                var _empnosforEmployer = from em in rep.GetAllActiveEmployees()
                                         where em.EmployerId == _employer.Id
                                         select em.EmpNo;
                List <string> Empnos = _empnosforEmployer.ToList();

                List <psuedovwPayslipDetails> saccorepaymentlist = (from i in rep.GetvwPayslipDetails("SACCO", _current, _period, _year)
                                                                    where Empnos.Contains(i.EmpNo)
                                                                    select i).ToList();

                foreach (var pm in saccorepaymentlist)
                {
                    saccorepayment sr = new saccorepayment()
                    {
                        employeename     = pm.Surname.Trim() + ", " + pm.OtherNames.Trim(),
                        employeenumber   = pm.EmpNo,
                        SaccoDescription = pm.ItemId,
                        monthamount      = pm.Amount,
                        ytdamt           = pm.YTD
                    };
                    saccorepayment.Add(sr);
                }
                return(saccorepayment);
            }
            catch (Exception ex)
            {
                Utils.ShowError(ex);
                return(null);
            }
        }
        //table details
        private void AddBodyTableDetail(saccorepayment tr, ref int row, ref int col)
        {
            row++; col = 1;
            string cellrangeaddr1 = document.IntAlpha(col) + row;

            document.createHeaders(row, col, tr.employeenumber, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, tr.employeename, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, tr.SaccoDescription, cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, tr.monthamount.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");

            col++;
            cellrangeaddr1 = document.IntAlpha(col) + row;
            document.createHeaders(row, col, tr.ytdamt.ToString("#,##0"), cellrangeaddr1, cellrangeaddr1, 0, "WHITE", true, 10, "n");
        }