private static void Write(List <RollList> list, ref ISheet sheet, IRow modelRow) { var startLine = 2; var serial = 1; foreach (var item in list) { var row = sheet.GetRow(startLine); if (row == null) { row = sheet.CreateRow(startLine); } startLine++; var cell = ExcelManager.GetCell(row, 0, modelRow); cell.SetCellValue(serial++); ExcelManager.GetCell(row, 1, modelRow).SetCellValue(item.Name); } }
private static void Write <T>(List <T> list, ref ISheet sheet, IRow modelRow) where T : BaseScore { var startLine = 1; foreach (var item in list) { var row = sheet.GetRow(startLine); if (row == null) { row = sheet.CreateRow(startLine); } startLine++; var cell = ExcelManager.GetCell(row, 0, modelRow); cell.SetCellValue(item.Name); ExcelManager.GetCell(row, 1, modelRow).SetCellValue(item.Times.HasValue ? item.Times.Value : 0); ExcelManager.GetCell(row, 2, modelRow).SetCellValue(item.ScoreValue ?? 0); ExcelManager.GetCell(row, 3, modelRow).SetCellValue(item.Average); ExcelManager.GetCell(row, 4, modelRow).SetCellValue(item.Record ?? 0); ExcelManager.GetCell(row, 5, modelRow).SetCellValue(item.DeDuck); ExcelManager.GetCell(row, 6, modelRow).SetCellValue(item.Degree.ToString()); } }