Ejemplo n.º 1
0
        private List <RockfallReportCsvDto> GetRecords(CsvReader csv)
        {
            var rows = new List <RockfallReportCsvDto>();

            while (csv.Read())
            {
                RockfallReportCsvDto row = null;

                try
                {
                    row = csv.GetRecord <RockfallReportCsvDto>();
                }
                catch (Exception ex)
                {
                    _logger.LogError(ex.ToString());
                    throw;
                }

                row.RowNum      = csv.Context.Row;
                row.ServiceArea = _serviceArea.ConvertToServiceAreaString(row.ServiceArea);
                rows.Add(row);
            }

            return(rows);
        }
        private string GetValidationEntityName(RockfallReportCsvDto untypedRow)
        {
            string entityName;

            if (untypedRow.StartLatitude.IsEmpty() || untypedRow.StartLongitude.IsEmpty() &&
                !(untypedRow.StartOffset.IsEmpty() || untypedRow.EndOffset.IsEmpty()))
            {
                entityName             = Entities.RockfallReportLrs;
                untypedRow.SpatialData = SpatialData.Lrs;
            }
            else
            {
                entityName             = Entities.RockfallReportGps;
                untypedRow.SpatialData = SpatialData.Gps;
            }

            return(entityName);
        }