Example #1
0
        public void WriteRow(ExcelWorksheet ws, DiaRelatorioViewModel dia, Cell cell)
        {
            ws.Cells[cell.format()].Value = dia.Data;

            cell.nextColumn();
            ws.Cells[cell.format()].Value = dia.Info;

            if (!WriteWorkDay(ws, dia, cell))
            {
                for (int i = 0; i < 4; i++) //Skip cells
                {
                    cell.nextColumn();
                }
            }

            cell.nextColumn();
            WriteTimeCell(ws, cell, dia.HorasTrabalhadas);

            cell.nextColumn();
            WriteTimeCell(ws, cell, dia.HorasDevedoras);

            cell.nextColumn();
            WriteTimeCell(ws, cell, dia.HorasExtras);

            cell.nextColumn();
            WriteTimeCell(ws, cell, dia.HorasExtras100);
        }
Example #2
0
        private bool WriteWorkDay(ExcelWorksheet ws, DiaRelatorioViewModel dia, Cell cell)
        {
            if (dia.DiaRelatorio is IDiaComPonto)
            {
                var diaComPonto = (dia.DiaRelatorio as IDiaComPonto);
                if (diaComPonto.PontoDia is DiaTrabalho)
                {
                    var diaTrabalho = (diaComPonto.PontoDia as DiaTrabalho);

                    cell.nextColumn();
                    WriteTimeCell(ws, cell, diaTrabalho.Inicio.ToString());

                    if (!WriteInterval(ws, diaTrabalho, cell))
                    {
                        cell.nextColumn();//Skip
                        cell.nextColumn();
                    }

                    cell.nextColumn();
                    WriteTimeCell(ws, cell, diaTrabalho.Fim.ToString());

                    return(true);
                }
            }

            return(false);
        }