private string GenerationData(string v, int indexRow, int indexColumn, IXLRangeRows rows) { var result = rows.ElementAt(indexRow).Cell(indexColumn).Value.ToString(); if (String.IsNullOrWhiteSpace(result) && rows.ElementAt(indexRow).Cell(indexColumn).IsMerged()) { return(v); } return(rows.ElementAt(indexRow).Cell(indexColumn).Value.ToString()); }
private List <ParserDateModel> GenerationMarksInCurrentActivity(int currentIndexActivity, Dictionary <int, int> dayDictionary, IXLRangeRows rows) { List <ParserDateModel> result = new List <ParserDateModel>(); for (var i = 0; i < dayDictionary.Count();) { var objectDay = rows.ElementAt(currentIndexActivity).Cell(dayDictionary.ElementAt(i).Key); if (objectDay.MergedRange() != null) { result.Add( new ParserDateModel() { Text = objectDay.Value.ToString(), day = dayDictionary.ElementAt(i).Value, lastDay = dayDictionary.ElementAt(i).Value + objectDay.MergedRange().ColumnCount() - 1 }); i = i + objectDay.MergedRange().ColumnCount(); continue; } if (!String.IsNullOrWhiteSpace(objectDay.Value.ToString())) { result.Add(new ParserDateModel() { IsExist = true, day = dayDictionary.ElementAt(i).Value }); } i++; } return(result); }
private Dictionary <int, int> GenerationDayDictionary(IXLRangeRows rows, int index) { var j = 2; Dictionary <int, int> dictionary = new Dictionary <int, int>(); while (true) { if (rows.ElementAt(index).Cell(j).MergedRange().ColumnCount() > 1) { var newElement = rows.ElementAt(index + 1); while (!String.IsNullOrWhiteSpace(newElement.Cell(j).Value.ToString())) { var tempSymbol = newElement.Cell(j).Address.ColumnNumber; var tempValue = Int32.Parse(newElement.Cell(j).Value.ToString()); dictionary[tempSymbol] = tempValue; j++; } break; } j++; } return(dictionary); }