Example #1
0
 private void colorizeCellAccordingToDaysPassed(int row, int column, int numberOfDays, ExcelSheet sheet)
 {
     if (this.numberIsInBetween(numberOfDays, 1, 7))
     {
         sheet.setCellColor(row, column, 153, 255, 102);
     }
     else if (this.numberIsInBetween(numberOfDays, 8, 14))
     {
         sheet.setCellColor(row, column, 255, 255, 102);
     }
     else if (this.numberIsInBetween(numberOfDays, 15, 28))
     {
         sheet.setCellColor(row, column, 83, 142, 213);
     }
     else if (28 <= numberOfDays)
     {
         sheet.setCellColor(row, column, 255, 0, 0);
     }
 }
Example #2
0
        //TODO: add it for a Lottery name, if it doesn't exists, create and initialize it (write the header)
        public void addEntryForWinningNumber(int day, int month, int year, string winningNumber)
        {
            ExcelSheet sheet   = this.file.getSheet(1);
            int        lastRow = sheet.getLastUsedRowNumber();
            int        newRow  = lastRow + 1;

            sheet.setCellText(newRow, 1, day.ToString());
            sheet.setCellText(newRow, 2, this.getMonthAsString(month) + "-" + year.ToString());
            sheet.setCellText(newRow, 3, winningNumber);

            while (this.isRowAnEmptyEntry(sheet, lastRow) && lastRow > 1)
            {
                lastRow--;
            }

            for (int i = 4; i <= 13; i++)
            {
                if (this.columnsToNumbersMap[i].Equals(winningNumber))
                {
                    sheet.setCellText(newRow, i, "SALIO");
                    sheet.setCellColor(newRow, i, 0, 255, 255);
                    this.drawnNumbers[i - 4] = true;
                }
                else
                {
                    if (this.numberHasBeenDrawn(i - 4))
                    {
                        this.addNonWinningEntry(lastRow, i, newRow, sheet);
                    }
                    else
                    {
                        sheet.setCellColor(newRow, i, 0, 0, 0);
                    }
                }
            }
            this.file.save();
        }
Example #3
0
        public void addEmptyEntry(int day, int month, int year)
        {
            ExcelSheet sheet  = this.file.getSheet(1);
            int        newRow = sheet.getLastUsedRowNumber() + 1;

            sheet.setCellText(newRow, 1, day.ToString());
            sheet.setCellText(newRow, 2, this.getMonthAsString(month));
            sheet.setCellText(newRow, 3, "");

            for (int i = 1; i <= this.COLUMNS_COUNT; i++)
            {
                sheet.setCellColor(newRow, i, 148, 138, 84);
            }
            this.file.save();
        }