public Les ( OfficeOpenXml.ExcelWorksheet sheet ) : ExcelMatch | ||
sheet | OfficeOpenXml.ExcelWorksheet | |
return | ExcelMatch |
public ExcelMatch Les(ExcelWorksheet sheet)
{
var row = 2;
var match = new ExcelMatch
{
MatchId = Guid.Parse(sheet.GetValue(ExcelSheet.Match.MatchId, row)),
Navn = sheet.GetValue(ExcelSheet.Match.Navn, row),
StartTid = DateTime.Parse(sheet.GetValue(ExcelSheet.Match.Starttid, row)),
SluttTid = DateTime.Parse(sheet.GetValue(ExcelSheet.Match.Sluttid, row)),
DefaultPoengFordeling = sheet.GetValue(ExcelSheet.Match.DefaultPostPoengfordeling, row)
};
LesGeobox(sheet, row, match);
LesVåpenOppsett(sheet, row, match);
AddOrUpdate(match);
LeggInnVåpen();
return match;
}
public void LesInn(byte[] excelBytes) { using (var stream = new MemoryStream(excelBytes)) { stream.Position = 0; using (ExcelPackage excelFile = new ExcelPackage(stream)) { var excel = excelFile.Workbook; var excelMatch = new MatchImport.ExcelMatch(); Les(excel, "Match", x => excelMatch = _matchImport.Les(x)); Les(excel, "Poster", x => _postImport.Les(x, excelMatch)); Les(excel, "Lag", x => _lagImport.Les(x, excelMatch)); Les(excel, "Deltakere", x => _deltakerImport.Les(x, excelMatch)); } } }