using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json.Serialization;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations.Schema;
using Parser_Xls_Integral;
using System.Data;
using NPOI.SS.Formula.Functions;


public class ExcelParser
{
    public static void Main(string[] args)
    {
        List<DefinicneUseky> definicneUsekyList = new List<DefinicneUseky>();
        List<Priepusty> priepustyList = new List<Priepusty>();
        List<NeusekoveInformacie> neusekoveList = new List<NeusekoveInformacie>();

        #region DefinicneUseky
        string filePath = "Definicne_useky_05_2024.xls";
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                DefinicneUseky rowData = new DefinicneUseky
                {
                    ID = row.GetCell(0)?.ToString(),
                    TU = row.GetCell(1)?.ToString(),
                    DU = row.GetCell(2)?.ToString(),
                    Od = row.GetCell(3)?.ToString(),
                    Do = row.GetCell(4)?.ToString(),
                    KmOd = row.GetCell(5)?.ToString(),
                    KmDo = row.GetCell(6)?.ToString(),
                    Kolajnost = row.GetCell(7)?.ToString(),
                    ElektrickaTrakcia = row.GetCell(8)?.ToString(),
                    ElektrickaTrakciaN = row.GetCell(9)?.ToString(),
                    StavebnaDlzka = row.GetCell(10)?.ToString(),
                    VysokorychlostnaTrat = row.GetCell(11)?.ToString(),
                    TichsiaTrat = row.GetCell(12)?.ToString(),
                    KategoriaTrate = row.GetCell(13)?.ToString(),
                    ReakcnyCasZZ = row.GetCell(14)?.ToString(),
                    PriznakStanicenia = row.GetCell(15)?.ToString(),
                    PriznakStaniceDefinicnyUsek = row.GetCell(16)?.ToString(),
                    CharakterTrate = row.GetCell(17)?.ToString(),
                    TypDopravy = row.GetCell(18)?.ToString(),
                    TypPrevadzky = row.GetCell(19)?.ToString(),
                    TypTrateTEN = row.GetCell(20)?.ToString(),
                    Poznamka = row.GetCell(21)?.ToString(),
                    KategoriaZatazenia = row.GetCell(22)?.ToString()
                };

                definicneUsekyList.Add(rowData);

                // You can now store or process rowData as needed.
            }
        }
        #endregion

        #region Priepusty
        filePath = "Priepusty.xls";
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 4; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                Priepusty rowData = new Priepusty
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    Rozchod = row.GetCell(4)?.ToString(),
                    Kategoria = row.GetCell(5)?.ToString(),
                    OznačenieRozchodu = row.GetCell(6)?.ToString(),
                    Trakcia = row.GetCell(7)?.ToString(),
                    Koridory = row.GetCell(8)?.ToString(),
                    KategoriaZatazeniaTrate = row.GetCell(9)?.ToString(),
                    CisloTTP = row.GetCell(10)?.ToString(),
                    JICPriepustu = row.GetCell(11)?.ToString(),
                    KmPolohaStreduPriepustu = row.GetCell(12)?.ToString(),
                    InterneCisloSAP = row.GetCell(13)?.ToString(),
                    TypPriepustu = row.GetCell(14)?.ToString(),
                    Umiestnenie = row.GetCell(15)?.ToString(),
                    TechMiestoUdrzby = row.GetCell(16)?.ToString(),
                    ObstaravaciaCena = row.GetCell(17)?.ToString(),
                    RokStavbyOpor = row.GetCell(18)?.ToString(),
                    RokPrestavbyOpor = row.GetCell(19)?.ToString(),
                    CelkovyPocetKolajiNaPriepuste = row.GetCell(20)?.ToString(),
                    PocetNosnychKonstrukcii = row.GetCell(21)?.ToString(),
                    KolajoveRozvetvenie = row.GetCell(22)?.ToString(),
                    KolajoveStyky = row.GetCell(23)?.ToString(),
                    UmiestnenieKabelovehoZlaby = row.GetCell(24)?.ToString(),
                    ZemSirka = row.GetCell(25)?.ToString(),
                    ZemDlzka = row.GetCell(26)?.ToString(),
                    Obec = row.GetCell(27)?.ToString(),
                    Kataster = row.GetCell(28)?.ToString(),
                    Okres = row.GetCell(29)?.ToString(),
                    Kraj = row.GetCell(30)?.ToString(),
                    DlzkaPriepustu = row.GetCell(31)?.ToString(),
                    VyskaPriepustu = row.GetCell(32)?.ToString(),
                    SirkaPriepustu = row.GetCell(33)?.ToString(),
                    CelkDlzkaNKPriepustu = row.GetCell(34)?.ToString(),
                    PocetPoliRur = row.GetCell(35)?.ToString(),
                    Vyska1Opory = row.GetCell(36)?.ToString(),
                    Vyska2Opory = row.GetCell(37)?.ToString(),
                    StatickySystem1Opory = row.GetCell(38)?.ToString(),
                    StatickySystem2Opory = row.GetCell(39)?.ToString(),
                    DruhKridel1Opory = row.GetCell(40)?.ToString(),
                    DruhKridel2Opory = row.GetCell(41)?.ToString(),
                    SucetVysokOpor = row.GetCell(42)?.ToString(),
                    MaterialOpor = row.GetCell(43)?.ToString(),
                    KategoriaZatazeniaStavby = row.GetCell(44)?.ToString(),
                    ZatazitelnostPriepustu = row.GetCell(45)?.ToString(),
                    StavNosnejKonstrukcie = row.GetCell(46)?.ToString(),
                    StavSpodnejStavby = row.GetCell(47)?.ToString(),
                    HodnotenieStavuObjektu = row.GetCell(48)?.ToString()
                };

                priepustyList.Add(rowData);
            }
        }
        #endregion

        #region Obmedzujúce prvky
        filePath = "Priepusty.xls"; // Adjust the path accordingly
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(1); // Assuming this is the first sheet

            List<ObmedzujucePrvky> obmedzujucePrvkyList = new List<ObmedzujucePrvky>();

            for (int i = 4; i <= sheet.LastRowNum; i++) // Assuming data starts at row 5
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                ObmedzujucePrvky rowData = new ObmedzujucePrvky
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    JICPriepustu = row.GetCell(4)?.ToString(),
                    TypPriepustu = row.GetCell(5)?.ToString(),
                    ObmedzujuciPrvok = row.GetCell(6)?.ToString(),
                    CelkovaDlzka = row.GetCell(7)?.ToString(),
                    VzdialenostOdLavejKolaje = row.GetCell(8)?.ToString(),
                    VzdialenostOdPravejKolaje = row.GetCell(9)?.ToString()
                };


                obmedzujucePrvkyList.Add(rowData);
            }
        }
        #endregion

        #region Premostené prekážky
        filePath = "Priepusty.xls";
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(2); // Assuming this is the third sheet (index 2)

            List<PremostenePrekazky> premostennePrekazkyList = new List<PremostenePrekazky>();

            for (int i = 4; i <= sheet.LastRowNum; i++) // Assuming data starts at row 5
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                PremostenePrekazky rowData = new PremostenePrekazky
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    JICPriepustu = row.GetCell(4)?.ToString(),
                    TypPriepustu = row.GetCell(5)?.ToString(),
                    TypPrekazky = row.GetCell(6)?.ToString(),
                    BlizsiPopis = row.GetCell(7)?.ToString(),
                    VolnaVyskaNadPriepustom = row.GetCell(8)?.ToString(),
                    StorocnyPrietok = row.GetCell(9)?.ToString(),
                    Poznamka = row.GetCell(10)?.ToString()
                };

                premostennePrekazkyList.Add(rowData);
            }
        }
        #endregion#region Svetlosť

        #region Svetlost

        filePath = "Priepusty.xls"; // Adjust the path accordingly
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(3);

            List<Svetlost> svetlostList = new List<Svetlost>();

            for (int i = 4; i <= sheet.LastRowNum; i++) // Assuming data starts at row 5
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                Svetlost rowData = new Svetlost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    JICPriepustu = row.GetCell(4)?.ToString(),
                    TypPriepustu = row.GetCell(5)?.ToString(),
                    PoradoveCislo = row.GetCell(6)?.ToString(),
                    SucetVyskyKolajovehoLozkaAPresypavky = row.GetCell(7)?.ToString(),
                    SvetlostKolmna = row.GetCell(8)?.ToString(),
                    SvetlostSikma = row.GetCell(9)?.ToString(),
                    UholKrizenia = row.GetCell(10)?.ToString(),
                    Poznamka = row.GetCell(11)?.ToString()
                };

                svetlostList.Add(rowData);
            }
        }
        #endregion

        #region Cudzie zariadenia
        filePath = "Priepusty.xls"; // Use the provided file path
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(4); // Assuming this is the fifth sheet (index 4)

            List<CudzieZariadenia> cudzieZariadeniaList = new List<CudzieZariadenia>();

            for (int i = 4; i <= sheet.LastRowNum; i++) // Assuming data starts at row 5
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                CudzieZariadenia rowData = new CudzieZariadenia
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    JICPriepustu = row.GetCell(4)?.ToString(),
                    TypPriepustu = row.GetCell(5)?.ToString(),
                    DruhCudziehoZariadenia = row.GetCell(6)?.ToString(),
                    SpravcaZariadenia = row.GetCell(7)?.ToString(),
                    Poznamka = row.GetCell(8)?.ToString()
                };

                cudzieZariadeniaList.Add(rowData);
            }
        }
        #endregion

        #region Kolaje
        filePath = "Priepusty.xls"; // Use the provided file path
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(5); // Assuming this is the sixth sheet (index 5)

            List<Kolaje> kolajeList = new List<Kolaje>();

            for (int i = 4; i <= sheet.LastRowNum; i++) // Assuming data starts at row 5
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                Kolaje rowData = new Kolaje
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    JICPriepustu = row.GetCell(4)?.ToString(),
                    TypPriepustu = row.GetCell(5)?.ToString(),
                    Cislo = row.GetCell(6)?.ToString(),
                    TU = row.GetCell(7)?.ToString(),
                    DU = row.GetCell(8)?.ToString(),
                    Umiestnenie = row.GetCell(9)?.ToString(),
                    ObmedzujucaRychlost1 = row.GetCell(10)?.ToString(),
                    ObmedzujucaRychlost2 = row.GetCell(11)?.ToString(),
                    KategoriaZatazeniaStZeleSpodku = row.GetCell(12)?.ToString(),
                    Zatazitelnost = row.GetCell(13)?.ToString(),
                    Poznamka = row.GetCell(14)?.ToString()
                };

                kolajeList.Add(rowData);

            }
        }
        #endregion

        #region Material Spodnej Stavby
        filePath = "Priepusty.xls"; // Use the provided file path
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(6); // Assuming this is the seventh sheet (index 6)

            List<MaterialSpodnejStavby> materialList = new List<MaterialSpodnejStavby>();

            for (int i = 4; i <= sheet.LastRowNum; i++) // Assuming data starts at row 5
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                MaterialSpodnejStavby rowData = new MaterialSpodnejStavby
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    JICPriepustu = row.GetCell(4)?.ToString(),
                    TypPriepustu = row.GetCell(5)?.ToString(),
                    CastSpodnejStavby = row.GetCell(6)?.ToString(),
                    MaterialCastiSpodnejStavby = row.GetCell(7)?.ToString(),
                    PrefabrikaciaSpodnejStavby = row.GetCell(8)?.ToString(),
                    PopisPrefabrikatu = row.GetCell(9)?.ToString()
                };

                materialList.Add(rowData);
            }
        }
        #endregion

        #region Nosne Konstrukcie
        filePath = "Priepusty.xls"; // Use the provided file path
        using (FileStream file = new FileStream("Priepusty.xls", FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(7); // Assuming this is the eighth sheet (index 7)

            List<NosneKonstrukcie> nosneKonstrukcieList = new List<NosneKonstrukcie>();

            for (int i = 4; i <= sheet.LastRowNum; i++) // Assuming data starts at row 5
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                NosneKonstrukcie rowData = new NosneKonstrukcie
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    JICPriepustu = row.GetCell(4)?.ToString(),
                    TypPriepustu = row.GetCell(5)?.ToString(),
                    PoradCisloNK = row.GetCell(6)?.ToString(),
                    HodnotenieNK = row.GetCell(7)?.ToString(),
                    NKKod1 = row.GetCell(8)?.ToString(),
                    NKKod2 = row.GetCell(9)?.ToString(),
                    DocasnaKonstrukcia = row.GetCell(10)?.ToString(),
                    EvidOznacenieProvizoria = row.GetCell(11)?.ToString(),
                    KonstrukciaPozdlzneDelenie = row.GetCell(12)?.ToString(),
                    BlizsiPopis = row.GetCell(13)?.ToString(),
                    DlzkaNK = row.GetCell(14)?.ToString(),
                    StavebnaVyska = row.GetCell(15)?.ToString(),
                    UkoncenieNK = row.GetCell(16)?.ToString(),
                    SikmostUkoncenia = row.GetCell(17)?.ToString(),
                    MostnyPredpis = row.GetCell(18)?.ToString(),
                    ZatazitelnostNK = row.GetCell(19)?.ToString(),
                    RokVyrobyNK = row.GetCell(20)?.ToString(),
                    RokZosilneniaNK = row.GetCell(21)?.ToString(),
                    TypHydroizolacieNK = row.GetCell(22)?.ToString(),
                    Poznamka = row.GetCell(23)?.ToString(),
                    SposobRozsireniaBetKonstrukcie = row.GetCell(24)?.ToString(),
                    RokRozsirenia = row.GetCell(25)?.ToString()
                };

                nosneKonstrukcieList.Add(rowData);
            }
        }
        #endregion

        #region Kolaje na nosnej konštrukcii
        filePath = "Priepusty.xls"; // Use the provided file path
        using (FileStream file = new FileStream("Priepusty.xls", FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(8); // Assuming this is the ninth sheet (index 8)

            List<KolajeNaNosnejKonstrukcii> kolajeNaNosnejKonstrukciiList = new List<KolajeNaNosnejKonstrukcii>();

            for (int i = 4; i <= sheet.LastRowNum; i++) // Assuming data starts at row 5
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                KolajeNaNosnejKonstrukcii rowData = new KolajeNaNosnejKonstrukcii
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    JICPriepustu = row.GetCell(4)?.ToString(),
                    TypPriepustu = row.GetCell(5)?.ToString(),
                    PoradCisloNK = row.GetCell(6)?.ToString(),
                    CisloKolaje = row.GetCell(7)?.ToString(),
                    SposobUlozeniaKolaje = row.GetCell(8)?.ToString(),
                    Poznamka = row.GetCell(9)?.ToString()
                };

                kolajeNaNosnejKonstrukciiList.Add(rowData);
            }
        }
        #endregion

        #region Neusekove Informacie
        filePath = "NeusekoveInformacie.xls";
        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file); // Use XSSFWorkbook for .xlsx files
            ISheet sheet = workbook.GetSheetAt(0); // Only one sheet, no need to select

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip header
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                NeusekoveInformacie rowData = new NeusekoveInformacie
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    OznačenieRozchodu = row.GetCell(7)?.ToString(),
                    Koridory = row.GetCell(8)?.ToString(),
                    CisloTTP = row.GetCell(9)?.ToString(),
                    TypDopravy = row.GetCell(10)?.ToString(),
                    TypTrate = row.GetCell(11)?.ToString(),
                    KategoriaZatazeniaTrate = row.GetCell(12)?.ToString(),
                    ZatazenieNa1m = row.GetCell(13)?.ToString(),
                    HmotnostNa1Napravu = row.GetCell(14)?.ToString(),
                    HmotnostNa2Naprav = row.GetCell(15)?.ToString(),
                    HmotnostNa2Nap4NapVoznov = row.GetCell(16)?.ToString(),
                    HmotnostNa6Naprav = row.GetCell(17)?.ToString(),
                    TriediaciZnak = row.GetCell(18)?.ToString(),
                    PopisTriediacehoZnaku = row.GetCell(19)?.ToString(),
                    TypPrevadzky = row.GetCell(20)?.ToString(),
                    CisloKolaje = row.GetCell(21)?.ToString(),
                    IndexKolaje = row.GetCell(22)?.ToString(),
                    KmOd = row.GetCell(23)?.ToString(),
                    KmDo = row.GetCell(24)?.ToString(),
                    Presah = row.GetCell(25)?.ToString(),
                    StavebnaDlzka = row.GetCell(26)?.ToString(),
                    UzitocnaDlzka = row.GetCell(27)?.ToString(),
                    Abnormalita = row.GetCell(28)?.ToString(),
                    NadmorskaVyska = row.GetCell(29)?.ToString(),
                    RadKolaje = row.GetCell(30)?.ToString(),
                    CisloIM = row.GetCell(31)?.ToString(),
                    CisloTM = row.GetCell(32)?.ToString(),
                    PriechodnePrierezyAObrysyVozidiel = row.GetCell(33)?.ToString(),
                    PrevladavajucaTrakcia = row.GetCell(34)?.ToString(),
                    TypPrevladavajucejTrakcie = row.GetCell(35)?.ToString(),
                    PrevladavajuceLozko = row.GetCell(36)?.ToString(),
                    PrevladujuciTvarZvrsku = row.GetCell(37)?.ToString(),
                    PrevladujuciTypPodvalov = row.GetCell(38)?.ToString(),
                    PrevladujuciTypUpevnenia = row.GetCell(39)?.ToString(),
                    ZatriedenieKolaje = row.GetCell(40)?.ToString(),
                    DopravneUrčenie = row.GetCell(41)?.ToString(),
                    ZatazenieTrate = row.GetCell(42)?.ToString(),
                    PocetVlakov = row.GetCell(43)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(44)?.ToString(),
                };
                neusekoveList.Add(rowData);

                // Create a formatted string for the row data
                string output =
                    $"Neúsekové informácie:\n" +
                    $"-----------------------------------------------\n" +
                    $"OR: {rowData.OR}\n" +
                    $"SMSÚ: {rowData.SMSU}\n" +
                    $"TU: {rowData.TU}\n" +
                    $"DU: {rowData.DU}\n" +
                    $"Názov DU: {rowData.NazovDU}\n" +
                    $"Kategória trate: {rowData.KategoriaTrate}\n" +
                    $"Rozchod: {rowData.Rozchod}\n" +
                    $"Označenie rozchodu: {rowData.OznačenieRozchodu}\n" +
                    $"Koridory: {rowData.Koridory}\n" +
                    $"Číslo TTP: {rowData.CisloTTP}\n" +
                    $"Typ dopravy: {rowData.TypDopravy}\n" +
                    $"Typ trate: {rowData.TypTrate}\n" +
                    $"Kategória zaťaženia trate: {rowData.KategoriaZatazeniaTrate}\n" +
                    $"Zaťaženie na 1m [kN]: {rowData.ZatazenieNa1m}\n" +
                    $"Hmotnosť na 1 nápravu [t]: {rowData.HmotnostNa1Napravu}\n" +
                    $"Hmotnosť na 2 nápravy [t]: {rowData.HmotnostNa2Naprav}\n" +
                    $"Hmotnosť na 2 nápravy 4-nápravových vozňov [t]: {rowData.HmotnostNa2Nap4NapVoznov}\n" +
                    $"Hmotnosť na 6 náprav [t]: {rowData.HmotnostNa6Naprav}\n" +
                    $"Triediaci znak: {rowData.TriediaciZnak}\n" +
                    $"Popis triediaceho znaku: {rowData.PopisTriediacehoZnaku}\n" +
                    $"Typ prevádzky: {rowData.TypPrevadzky}\n" +
                    $"Číslo koľaje: {rowData.CisloKolaje}\n" +
                    $"Index koľaje: {rowData.IndexKolaje}\n" +
                    $"Km od: {rowData.KmOd}\n" +
                    $"Km do: {rowData.KmDo}\n" +
                    $"Presah: {rowData.Presah}\n" +
                    $"Stavebná dĺžka [m]: {rowData.StavebnaDlzka}\n" +
                    $"Užitočná dĺžka [m]: {rowData.UzitocnaDlzka}\n" +
                    $"Abnormalita [m]: {rowData.Abnormalita}\n" +
                    $"Nadmorská výška [m n.m.]: {rowData.NadmorskaVyska}\n" +
                    $"Rád koľaje: {rowData.RadKolaje}\n" +
                    $"Číslo IM: {rowData.CisloIM}\n" +
                    $"Číslo TM: {rowData.CisloTM}\n" +
                    $"Priechodné prierezy a obrysy vozidiel: {rowData.PriechodnePrierezyAObrysyVozidiel}\n" +
                    $"Prevládajúca trakcia: {rowData.PrevladavajucaTrakcia}\n" +
                    $"Typ prevládajúcej trakcie: {rowData.TypPrevladavajucejTrakcie}\n" +
                    $"Prevládajúce lôžko: {rowData.PrevladavajuceLozko}\n" +
                    $"Prevládajúci tvar zvršku: {rowData.PrevladujuciTvarZvrsku}\n" +
                    $"Prevládajúci typ podvalov: {rowData.PrevladujuciTypPodvalov}\n" +
                    $"Prevládajúci typ upevnenia: {rowData.PrevladujuciTypUpevnenia}\n" +
                    $"Zatriedenie koľaje: {rowData.ZatriedenieKolaje}\n" +
                    $"Dopravné určenie: {rowData.DopravneUrčenie}\n" +
                    $"Zaťaženie trate: {rowData.ZatazenieTrate}\n" +
                    $"Počet vlakov: {rowData.PocetVlakov}\n" +
                    $"Dátum poslednej zmeny: {rowData.DatumPoslednejZmeny}\n" +
                    $"-----------------------------------------------";

                // Output the formatted string
                // Console.WriteLine(output);
            }

        }
        #endregion

        #region Tratove Rychlosti
        // File path to the Excel file
        filePath = "TratoveRychlosti.xls"; // Replace with your actual file path
        List<TratoveRychlosti> tratoveRychlostiList = new List<TratoveRychlosti>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);
                if (row == null) continue; // Skip empty rows

                TratoveRychlosti rowData = new TratoveRychlosti
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    OznacenieRozchodu = row.GetCell(7)?.ToString(),
                    Koridory = row.GetCell(8)?.ToString(),
                    CisloTTP = row.GetCell(9)?.ToString(),
                    TriediaciZnak = row.GetCell(10)?.ToString(),
                    PopisTriediacehoZnaku = row.GetCell(11)?.ToString(),
                    TypPrevadzky = row.GetCell(12)?.ToString(),
                    CisloKolaje = row.GetCell(13)?.ToString(),
                    IndexKolaje = row.GetCell(14)?.ToString(),
                    KmOd = row.GetCell(15)?.ToString(),
                    KmDo = row.GetCell(16)?.ToString(),
                    DlzkaM = row.GetCell(17)?.ToString(),
                    KmOd2 = row.GetCell(18)?.ToString(),
                    KmDo2 = row.GetCell(19)?.ToString(),
                    Dlzka2M = row.GetCell(20)?.ToString(),
                    AbnormalitaM = row.GetCell(21)?.ToString(),
                    NajvyssiaTratovaRychlostKmh = row.GetCell(22)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(23)?.ToString()
                };

                tratoveRychlostiList.Add(rowData);
            }
        }
        #endregion

        #region TROpacnySmer
        // File path to the Excel file
        filePath = "TROpacnySmer.xls"; // Replace with your actual file path
        List<TratoveRychlostiVOpacnomSmer> tratoveRychlostiVOpacnomSmerList = new List<TratoveRychlostiVOpacnomSmer>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                TratoveRychlostiVOpacnomSmer rowData = new TratoveRychlostiVOpacnomSmer
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    OznacenieRozchodu = row.GetCell(7)?.ToString(),
                    Koridory = row.GetCell(8)?.ToString(),
                    CisloTTP = row.GetCell(9)?.ToString(),
                    TriediaciZnak = row.GetCell(10)?.ToString(),
                    PopisTriediacehoZnaku = row.GetCell(11)?.ToString(),
                    TypPrevadzky = row.GetCell(12)?.ToString(),
                    CisloKolaje = row.GetCell(13)?.ToString(),
                    IndexKolaje = row.GetCell(14)?.ToString(),
                    KmOd = row.GetCell(15)?.ToString(),
                    KmDo = row.GetCell(16)?.ToString(),
                    DlzkaM = row.GetCell(17)?.ToString(),
                    KmOd2 = row.GetCell(18)?.ToString(),
                    KmDo2 = row.GetCell(19)?.ToString(),
                    Dlzka2M = row.GetCell(20)?.ToString(),
                    AbnormalitaM = row.GetCell(21)?.ToString(),
                    NajvyssiaTratovaRychlostKmh = row.GetCell(22)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(23)?.ToString(),
                    Poznamka = row.GetCell(24)?.ToString()
                };

                tratoveRychlostiVOpacnomSmerList.Add(rowData);
            }
        }
        #endregion

        #region TrvaloZnizeneTR
        List<TrvaloZnizeneTratoveRychlosti> trvaloZnizeneTratoveRychlostiList = new List<TrvaloZnizeneTratoveRychlosti>();

        using (FileStream file = new FileStream("TrvaloZnizeneTR.xls", FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                TrvaloZnizeneTratoveRychlosti rowData = new TrvaloZnizeneTratoveRychlosti
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    OznacenieRozchodu = row.GetCell(7)?.ToString(),
                    Koridory = row.GetCell(8)?.ToString(),
                    CisloTTP = row.GetCell(9)?.ToString(),
                    TriediaciZnak = row.GetCell(10)?.ToString(),
                    PopisTriediacehoZnaku = row.GetCell(11)?.ToString(),
                    TypPrevadzky = row.GetCell(12)?.ToString(),
                    CisloKolaje = row.GetCell(13)?.ToString(),
                    IndexKolaje = row.GetCell(14)?.ToString(),
                    KmOd = row.GetCell(15)?.ToString(),
                    KmDo = row.GetCell(16)?.ToString(),
                    DlzkaM = row.GetCell(17)?.ToString(),
                    KmOd2 = row.GetCell(18)?.ToString(),
                    KmDo2 = row.GetCell(19)?.ToString(),
                    Dlzka2M = row.GetCell(20)?.ToString(),
                    AbnormalitaM = row.GetCell(21)?.ToString(),
                    ZnizenaTratovaRychlostKmh = row.GetCell(22)?.ToString(),
                    RozdielOprotiNajvysejTratovejRychlostiKmh = row.GetCell(23)?.ToString(),
                    DovodZnizenia = row.GetCell(24)?.ToString(),
                    PocetVyhybiek = row.GetCell(25)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(26)?.ToString(),
                    Poznamka = row.GetCell(27)?.ToString()
                };

                trvaloZnizeneTratoveRychlostiList.Add(rowData);
            }
        }
        #endregion

        #region SmerovePomery
        // File path to the Excel file
        filePath = "SmerovePomery.xls"; // Replace with your actual file path
        List<SmerovePomery> smerovePomeryList = new List<SmerovePomery>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                SmerovePomery rowData = new SmerovePomery
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    TriediaciZnak = row.GetCell(7)?.ToString(),
                    PopisTriediacehoZnaku = row.GetCell(8)?.ToString(),
                    CisloKolaje = row.GetCell(9)?.ToString(),
                    IndexKolaje = row.GetCell(10)?.ToString(),
                    KmOdNeusek = row.GetCell(11)?.ToString(),
                    KmDoNeusek = row.GetCell(12)?.ToString(),
                    DlzkaNeusekM = row.GetCell(13)?.ToString(),
                    KmOdSmerovyPomer = row.GetCell(14)?.ToString(),
                    KmDoSmerovyPomer = row.GetCell(15)?.ToString(),
                    DlzkaSmerovyPomerM = row.GetCell(16)?.ToString(),
                    AbnormalitaM = row.GetCell(17)?.ToString(),
                    Typ = row.GetCell(18)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(19)?.ToString(),
                    KmOdObluk = row.GetCell(20)?.ToString(),
                    KmDoObluk = row.GetCell(21)?.ToString(),
                    DlzkaDoMObluk = row.GetCell(22)?.ToString(),
                    SmerObluka = row.GetCell(23)?.ToString(),
                    PolomerM = row.GetCell(24)?.ToString(),
                    PrevysenieMM = row.GetCell(25)?.ToString(),
                    RozsirenieMM = row.GetCell(26)?.ToString(),
                    ProjektovanaRychlostKmh = row.GetCell(27)?.ToString(),
                    KmOdKruz = row.GetCell(28)?.ToString(),
                    KmDoKruz = row.GetCell(29)?.ToString(),
                    DlzkaDoKruzM = row.GetCell(30)?.ToString(),
                    KmOdPrechodnica1 = row.GetCell(31)?.ToString(),
                    KmDoPrechodnica1 = row.GetCell(32)?.ToString(),
                    DlzkaPrechodnica1M = row.GetCell(33)?.ToString(),
                    KmOdPrechodnica2 = row.GetCell(34)?.ToString(),
                    KmDoPrechodnica2 = row.GetCell(35)?.ToString(),
                    DlzkaPrechodnica2M = row.GetCell(36)?.ToString(),
                    KmOdVzostupnica1 = row.GetCell(37)?.ToString(),
                    KmDoVzostupnica1 = row.GetCell(38)?.ToString(),
                    DlzkaVzostupnica1M = row.GetCell(39)?.ToString(),
                    KmOdVzostupnica2 = row.GetCell(40)?.ToString(),
                    KmDoVzostupnica2 = row.GetCell(41)?.ToString(),
                    DlzkaVzostupnica2M = row.GetCell(42)?.ToString(),
                    SuciniteleSklonuV = row.GetCell(43)?.ToString(),
                    HodnotaSuciniteleSklonu = row.GetCell(44)?.ToString(),
                    KmOdPrevysenie = row.GetCell(45)?.ToString(),
                    KmDoPrevysenie = row.GetCell(46)?.ToString(),
                    DlzkaPrevysenieM = row.GetCell(47)?.ToString(),
                    TvarPrevysenie = row.GetCell(48)?.ToString(),
                    SuciniteleSklonu2V = row.GetCell(49)?.ToString(),
                    HodnotaSuciniteleSklonu2 = row.GetCell(50)?.ToString(),
                    TypPrevysenia = row.GetCell(51)?.ToString(),
                    NedostatokIMm = row.GetCell(52)?.ToString(),
                    PrebytokEMm = row.GetCell(53)?.ToString(),
                    DatumPoslednejZmenyObluk = row.GetCell(54)?.ToString(),
                    Poznamka = row.GetCell(55)?.ToString()
                };

                smerovePomeryList.Add(rowData);
            }
        }
        #endregion

        #region SklonovePomery
        // File path to the Excel file
        filePath = "SklonovePomery.xls"; // Replace with your actual file path
        List<SklonovePomery> sklonovePomeryList = new List<SklonovePomery>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                SklonovePomery rowData = new SklonovePomery
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    OznacenieRozchodu = row.GetCell(7)?.ToString(),
                    TriediaciZnak = row.GetCell(8)?.ToString(),
                    PopisTriediacehoZnaku = row.GetCell(9)?.ToString(),
                    TypPrevadzky = row.GetCell(10)?.ToString(),
                    CisloKolaje = row.GetCell(11)?.ToString(),
                    IndexKolaje = row.GetCell(12)?.ToString(),
                    KmOd = row.GetCell(13)?.ToString(),
                    KmDo = row.GetCell(14)?.ToString(),
                    DlzkaM = row.GetCell(15)?.ToString(),
                    KmOd2 = row.GetCell(16)?.ToString(),
                    KmDo2 = row.GetCell(17)?.ToString(),
                    Dlzka2M = row.GetCell(18)?.ToString(),
                    AbnormalitaM = row.GetCell(19)?.ToString(),
                    Stav = row.GetCell(20)?.ToString(),
                    SklonPromile = row.GetCell(21)?.ToString(),
                    PolomerZakruzeniaM = row.GetCell(22)?.ToString(),
                    DlzkaDotycniceM = row.GetCell(23)?.ToString(),
                    CelkovaDlzkaM = row.GetCell(24)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(25)?.ToString(),
                    Poznamka = row.GetCell(26)?.ToString()
                };

                sklonovePomeryList.Add(rowData);
            }
        }
        #endregion

        #region Kolajnica
        // File path to the Excel file
        filePath = "PrehladKolajnic.xls"; // Replace with your actual file path
        List<Kolajnica> kolajnicaList = new List<Kolajnica>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                Kolajnica rowData = new Kolajnica
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    OznacenieRozchodu = row.GetCell(7)?.ToString(),
                    TriediaciZnak = row.GetCell(8)?.ToString(),
                    PopisTriediacehoZnaku = row.GetCell(9)?.ToString(),
                    TypPrevadzky = row.GetCell(10)?.ToString(),
                    CisloKolaje = row.GetCell(11)?.ToString(),
                    IndexKolaje = row.GetCell(12)?.ToString(),
                    KmOd = row.GetCell(13)?.ToString(),
                    KmDo = row.GetCell(14)?.ToString(),
                    DlzkaM = row.GetCell(15)?.ToString(),
                    KmOd2 = row.GetCell(16)?.ToString(),
                    KmDo2 = row.GetCell(17)?.ToString(),
                    Dlzka2M = row.GetCell(18)?.ToString(),
                    AbnormalitaM = row.GetCell(19)?.ToString(),
                    Pas = row.GetCell(20)?.ToString(),
                    TvarKolajnice = row.GetCell(21)?.ToString(),
                    Pevnost = row.GetCell(22)?.ToString(),
                    Legovanie = row.GetCell(23)?.ToString(),
                    Umiestnenie = row.GetCell(24)?.ToString(),
                    SklonKolajnicovehoPasu = row.GetCell(25)?.ToString(),
                    DlzkaPoleM = row.GetCell(26)?.ToString(),
                    DatumVlozenia = row.GetCell(27)?.ToString(),
                    StavPriVlozeni = row.GetCell(28)?.ToString(),
                    RokVyroby = row.GetCell(29)?.ToString(),
                    Vyrobca = row.GetCell(30)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(31)?.ToString(),
                    Poznamka = row.GetCell(32)?.ToString()
                };

                kolajnicaList.Add(rowData);
            }
        }
        #endregion

        #region Vyhybka
        // File path to the Excel file
        filePath = "Vyhybky.xls"; // Replace with your actual file path
        List<Vyhybka> vyhybkaList = new List<Vyhybka>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                Vyhybka rowData = new Vyhybka
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    OznacenieRozchodu = row.GetCell(7)?.ToString(),
                    TriediaciZnak = row.GetCell(8)?.ToString(),
                    PopisTriediacehoZnaku = row.GetCell(9)?.ToString(),
                    TypPrevadzky = row.GetCell(10)?.ToString(),
                    CisloKolaje = row.GetCell(11)?.ToString(),
                    IndexKolaje = row.GetCell(12)?.ToString(),
                    KmOd = row.GetCell(13)?.ToString(),
                    KmDo = row.GetCell(14)?.ToString(),
                    DlzkaM = row.GetCell(15)?.ToString(),
                    Konstrukcia = row.GetCell(16)?.ToString(),
                    TvarZapisu = row.GetCell(17)?.ToString(),
                    Cislo = row.GetCell(18)?.ToString(),
                    Index = row.GetCell(19)?.ToString(),
                    TriediaciZnak2 = row.GetCell(20)?.ToString(),
                    VetvenieDoTUDU = row.GetCell(21)?.ToString(),
                    Presah = row.GetCell(22)?.ToString(),
                    KmPoloha = row.GetCell(23)?.ToString(),
                    StavebnaDlzkaM = row.GetCell(24)?.ToString(),
                    TechnickeMiesto = row.GetCell(25)?.ToString(),
                    KolajVPriamomSmer = row.GetCell(26)?.ToString(),
                    VOdbočnomSmer = row.GetCell(27)?.ToString(),
                    RadVyhybky = row.GetCell(28)?.ToString(),
                    RozchodKolajePriama = row.GetCell(29)?.ToString(),
                    RozchodKolajeOdbočna = row.GetCell(30)?.ToString(),
                    TvarKolajnic = row.GetCell(31)?.ToString(),
                    PodvalyVoVyhybkeDruh = row.GetCell(32)?.ToString(),
                    TypPodvalov = row.GetCell(33)?.ToString(),
                    TypVyhybky = row.GetCell(34)?.ToString(),
                    Kombinacia = row.GetCell(35)?.ToString(),
                    ZatriedenieVyhybky = row.GetCell(36)?.ToString(),
                    DopravneUrcenie = row.GetCell(37)?.ToString(),
                    DatumVlozenia = row.GetCell(38)?.ToString(),
                    StavPriVlozeni = row.GetCell(39)?.ToString(),
                    UmiestnenieVKolajisku = row.GetCell(40)?.ToString(),
                    Orientacia = row.GetCell(41)?.ToString(),
                    SposobZadaniaOdbočenia = row.GetCell(42)?.ToString(),
                    UholPomerOdbočenia = row.GetCell(43)?.ToString(),
                    Polomer = row.GetCell(44)?.ToString(),
                    PolomerPoTransformaciiHM = row.GetCell(45)?.ToString(),
                    PolomerPoTransformaciiOS = row.GetCell(46)?.ToString(),
                    PocetVyhybkovychJednotiek = row.GetCell(47)?.ToString(),
                    CisloVzorovehoListu = row.GetCell(48)?.ToString(),
                    SmerOdbočeniaVyhybky = row.GetCell(49)?.ToString(),
                    SmerOdbočeniaSrdcovky = row.GetCell(50)?.ToString(),
                    PolohaVymennikovJazykov = row.GetCell(51)?.ToString(),
                    PolohaVymennikovSrdcovky = row.GetCell(52)?.ToString(),
                    KonstrukciaSrdcovky1 = row.GetCell(53)?.ToString(),
                    NadvyšenieKridlovejKolajnice1 = row.GetCell(54)?.ToString(),
                    SposobNadvyšenia1 = row.GetCell(55)?.ToString(),
                    KonstrukciaSrdcovky2 = row.GetCell(56)?.ToString(),
                    NadvyšenieKridlovejKolajnice2 = row.GetCell(57)?.ToString(),
                    SposobNadvyšenia2 = row.GetCell(58)?.ToString(),
                    KonstrukciaJazykov = row.GetCell(59)?.ToString(),
                    DruhZaveru = row.GetCell(60)?.ToString(),
                    KonstrukciaPridrznice = row.GetCell(61)?.ToString(),
                    UpevneniePridrznice = row.GetCell(62)?.ToString(),
                    PrestavnikJazykov = row.GetCell(63)?.ToString(),
                    UpevneniePrestavnikaJazykov = row.GetCell(64)?.ToString(),
                    PrestavnikSrdcovky = row.GetCell(65)?.ToString(),
                    UpevneniePrestavnikaSrdcovky = row.GetCell(66)?.ToString(),
                    UpravaKlznýchStoliciek = row.GetCell(67)?.ToString(),
                    UpevnenieOpornice = row.GetCell(68)?.ToString(),
                    ZvlastneVybavenie = row.GetCell(69)?.ToString(),
                    KolajoveLozko = row.GetCell(70)?.ToString(),
                    RychlostHM = row.GetCell(71)?.ToString(),
                    RychlostOS = row.GetCell(72)?.ToString(),
                    KolajovyObvod = row.GetCell(73)?.ToString(),
                    PocetIzolovanychStykov = row.GetCell(74)?.ToString(),
                    RokVyroby = row.GetCell(75)?.ToString(),
                    RokZvarenia = row.GetCell(76)?.ToString(),
                    VyrobcaKonstrukcie = row.GetCell(77)?.ToString(),
                    MenePrísnePrevadzkovéHodnoty = row.GetCell(78)?.ToString(),
                    MinPriemerKolesaPrechod = row.GetCell(79)?.ToString(),
                    HodnotaMinPriemeruKolesaRI = row.GetCell(80)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(81)?.ToString(),
                    Poznamka = row.GetCell(82)?.ToString()
                };

                vyhybkaList.Add(rowData);
            }
        }

        // Now, you can use the vyhybkaList for further processing
        #endregion

        #region Tunel
        // File path to the Excel file
        filePath = "Tunely.xls"; // Replace with your actual file path
        List<Tunel> tunelList = new List<Tunel>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                Tunel rowData = new Tunel
                {
                    OR = row.GetCell(0)?.ToString(),
                    NazovOR = row.GetCell(1)?.ToString(),
                    SMSU = row.GetCell(2)?.ToString(),
                    NazovSMSU = row.GetCell(3)?.ToString(),
                    TU = row.GetCell(4)?.ToString(),
                    NazovTU = row.GetCell(5)?.ToString(),
                    DU = row.GetCell(6)?.ToString(),
                    NazovDU = row.GetCell(7)?.ToString(),
                    KategoriaTrate = row.GetCell(8)?.ToString(),
                    OznacenieRozchodu = row.GetCell(9)?.ToString(),
                    Trakcia = row.GetCell(10)?.ToString(),
                    Koridory = row.GetCell(11)?.ToString(),
                    KategoriaZvislehoZatazenia = row.GetCell(12)?.ToString(),
                    CisloTTP = row.GetCell(13)?.ToString(),
                    EvidencneCislo = row.GetCell(14)?.ToString(),
                    Nazov = row.GetCell(15)?.ToString(),
                    MimoPrevadzky = row.GetCell(16)?.ToString(),
                    CisloVyhlasenia = row.GetCell(17)?.ToString(),
                    TypVyhlaseniaEI = row.GetCell(18)?.ToString(),
                    TypVyhlaseniaES = row.GetCell(19)?.ToString(),
                    NudzoznyPlan = row.GetCell(20)?.ToString(),
                    KolajC1PPOZKV = row.GetCell(21)?.ToString(),
                    KolajC1PPOZKV_500m = row.GetCell(22)?.ToString(),
                    KolajC2PPOZKV = row.GetCell(23)?.ToString(),
                    KolajC2PPOZKV_500m = row.GetCell(24)?.ToString(),
                    KolajC3PPOZKV = row.GetCell(25)?.ToString(),
                    KolajC3PPOZKV_500m = row.GetCell(26)?.ToString(),
                    KmPoloha = row.GetCell(27)?.ToString(),
                    GPSZemDlzka = row.GetCell(28)?.ToString(),
                    GPSZemSirka = row.GetCell(29)?.ToString(),
                    Kraj = row.GetCell(30)?.ToString(),
                    Okres = row.GetCell(31)?.ToString(),
                    Obec = row.GetCell(32)?.ToString(),
                    Kataster = row.GetCell(33)?.ToString(),
                    DlzkaGalerie = row.GetCell(34)?.ToString(),
                    KmPolohaVychod = row.GetCell(35)?.ToString(),
                    GPSZemDlzkaVychod = row.GetCell(36)?.ToString(),
                    GPSZemSirkaVychod = row.GetCell(37)?.ToString(),
                    KrajVychod = row.GetCell(38)?.ToString(),
                    OkresVychod = row.GetCell(39)?.ToString(),
                    ObecVychod = row.GetCell(40)?.ToString(),
                    KatasterVychod = row.GetCell(41)?.ToString(),
                    DlzkaGalerieVychod = row.GetCell(42)?.ToString(),
                    PoradoveCislo = row.GetCell(43)?.ToString(),
                    DlzkaTunela = row.GetCell(44)?.ToString(),
                    DlzkaHlobenejCastiP1 = row.GetCell(45)?.ToString(),
                    DlzkaRazenejCasti = row.GetCell(46)?.ToString(),
                    DlzkaHlobenejCastiP2 = row.GetCell(47)?.ToString(),
                    UmiestnenieTunela = row.GetCell(48)?.ToString(),
                    PriebehNivelety = row.GetCell(49)?.ToString(),
                    PamiatkovoChranyObjekt = row.GetCell(50)?.ToString(),
                    PopisPamiatkovoChranyObjekt = row.GetCell(51)?.ToString(),
                    NarodnyParkCHKO = row.GetCell(52)?.ToString(),
                    NazovNarodnehoParkuCHKO = row.GetCell(53)?.ToString(),
                    PovrchUzemiaNadTunelom = row.GetCell(54)?.ToString(),
                    MaxVyskaNadzemia = row.GetCell(55)?.ToString(),
                    PopisMaxVysky = row.GetCell(56)?.ToString(),
                    MinVyskaNadzemia = row.GetCell(57)?.ToString(),
                    PopisMinVysky = row.GetCell(58)?.ToString(),
                    GeologickePomery = row.GetCell(59)?.ToString(),
                    HorskeUtvar = row.GetCell(60)?.ToString(),
                    Kolajnost = row.GetCell(61)?.ToString(),
                    TrakciaVykon = row.GetCell(62)?.ToString(),
                    TvarOstenia = row.GetCell(63)?.ToString(),
                    SposobRealizacie = row.GetCell(64)?.ToString(),
                    TunelovaciaMetoda = row.GetCell(65)?.ToString(),
                    PocetKolaji = row.GetCell(66)?.ToString(),
                    KolajC1NI = row.GetCell(67)?.ToString(),
                    KolajC2NI = row.GetCell(68)?.ToString(),
                    KolajC3NI = row.GetCell(69)?.ToString(),
                    CisloUctovnehoOkruhu = row.GetCell(70)?.ToString(),
                    CisloIM = row.GetCell(71)?.ToString(),
                    CisloTechnickehoMiestaObjektu = row.GetCell(72)?.ToString(),
                    HodnotaTunelaNadobudacia = row.GetCell(73)?.ToString(),
                    DokoncenieTunela = row.GetCell(74)?.ToString(),
                    VekTunela = row.GetCell(75)?.ToString(),
                    HlavnaPrehliadka = row.GetCell(76)?.ToString(),
                    MeranieSTP = row.GetCell(77)?.ToString(),
                    DruhDokumentacie = row.GetCell(78)?.ToString(),
                    UlozenieDokumentacie = row.GetCell(79)?.ToString(),
                    PocetUdrziavacichJednotiek = row.GetCell(80)?.ToString(),
                    KlasifikaciaCelkovhoStavu = row.GetCell(81)?.ToString(),
                    PopisStavuTunela = row.GetCell(82)?.ToString(),
                    Poznamky = row.GetCell(83)?.ToString()
                };

                tunelList.Add(rowData);
            }
        }
        #endregion

        #region Priecestie
        // File path to the Excel file
        filePath = "Priecestia.xls"; // Replace with your actual file path
        List<Priecestie> priecestieList = new List<Priecestie>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                Priecestie rowData = new Priecestie
                {
                    JIC = row.GetCell(0)?.ToString(),
                    VNS = row.GetCell(1)?.ToString(),
                    NazovVNS = row.GetCell(2)?.ToString(),
                    SMSU = row.GetCell(3)?.ToString(),
                    NazovOR = row.GetCell(4)?.ToString(),
                    Kraj = row.GetCell(5)?.ToString(),
                    Okres = row.GetCell(6)?.ToString(),
                    Obec = row.GetCell(7)?.ToString(),
                    KmPolohaPriecestia = row.GetCell(8)?.ToString(),
                    PocetKolaji = row.GetCell(9)?.ToString(),
                    MiestnyNazov = row.GetCell(10)?.ToString(),
                    TU = row.GetCell(11)?.ToString(),
                    NazovTU = row.GetCell(12)?.ToString(),
                    DU = row.GetCell(13)?.ToString(),
                    NazovDU = row.GetCell(14)?.ToString(),
                    DruhKomunikacie = row.GetCell(15)?.ToString(),
                    KlasifikaciaStavu = row.GetCell(16)?.ToString(),
                    KategoriaTrate = row.GetCell(17)?.ToString(),
                    SpecifikaciaKrizovania = row.GetCell(18)?.ToString(),
                    TypPriecestnejKonstrukcie = row.GetCell(19)?.ToString()
                };

                priecestieList.Add(rowData);
            }
        }

        // Now, you can use the priecestieList for further processing
        #endregion

        #region Mosty
        // File path to the Excel file
        filePath = "Mosty.xls"; // Replace with your actual file path
        List<Most> mostyList = new List<Most>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                Most rowData = new Most
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    Rozchod = row.GetCell(4)?.ToString(),
                    Kategoria = row.GetCell(5)?.ToString(),
                    OznačenieRozchodu = row.GetCell(6)?.ToString(),
                    Trakcia = row.GetCell(7)?.ToString(),
                    Koridory = row.GetCell(8)?.ToString(),
                    KategoriaZvislehoZatazenia = row.GetCell(9)?.ToString(),
                    CisloTTP = row.GetCell(10)?.ToString(),
                    JICMosta = row.GetCell(11)?.ToString(),
                    KmPolohaStreduMosta = row.GetCell(12)?.ToString(),
                    OdKm = row.GetCell(13)?.ToString(),
                    DoKm = row.GetCell(14)?.ToString(),
                    InterniCisloSAP = row.GetCell(15)?.ToString(),
                    TypMosta = row.GetCell(16)?.ToString(),
                    Umiestnenie = row.GetCell(17)?.ToString(),
                    TechnickeMiestoUdrzby = row.GetCell(18)?.ToString(),
                    ObstaranovaciaCena = row.GetCell(19)?.ToString(),
                    RokStavbyOporAPilierov = row.GetCell(20)?.ToString(),
                    RokPrestavbyOporAPilierov = row.GetCell(21)?.ToString(),
                    PocetMostPoli = row.GetCell(22)?.ToString(),
                    PocetKolaji = row.GetCell(23)?.ToString(),
                    PocetNosnychKonstru = row.GetCell(24)?.ToString(),
                    CelkovaNaterovaPlocha = row.GetCell(25)?.ToString(),
                    NepritomnostKolaje = row.GetCell(26)?.ToString(),
                    KolajoveRozvetvenie = row.GetCell(27)?.ToString(),
                    KolajoveStyky = row.GetCell(28)?.ToString(),
                    UmiestnenieKabelovehoZlabu = row.GetCell(29)?.ToString(),
                    ZemSirka = row.GetCell(30)?.ToString(),
                    ZemDlzka = row.GetCell(31)?.ToString(),
                    Obec = row.GetCell(32)?.ToString(),
                    Kataster = row.GetCell(33)?.ToString(),
                    Okres = row.GetCell(34)?.ToString(),
                    Kraj = row.GetCell(35)?.ToString(),
                    Poznamka = row.GetCell(36)?.ToString(),
                    DlzkaPremostenia = row.GetCell(37)?.ToString(),
                    CelkDlzkaNKMosta = row.GetCell(38)?.ToString(),
                    DlzkaMosta = row.GetCell(39)?.ToString(),
                    VyškaMosta = row.GetCell(40)?.ToString(),
                    SirkaMosta = row.GetCell(41)?.ToString(),
                    SmerSikmosti = row.GetCell(42)?.ToString(),
                    SikmostMosta = row.GetCell(43)?.ToString(),
                    SikmostMostaD = row.GetCell(44)?.ToString(),
                    Vyška1Opory = row.GetCell(45)?.ToString(),
                    Vyška2Opory = row.GetCell(46)?.ToString(),
                    StatickySystem1Opory = row.GetCell(47)?.ToString(),
                    StatickySystem2Opory = row.GetCell(48)?.ToString(),
                    DruhKridel1Opory = row.GetCell(49)?.ToString(),
                    DruhKridel2Opory = row.GetCell(50)?.ToString(),
                    SucetVysokPilierov = row.GetCell(51)?.ToString(),
                    MaterialPilierov = row.GetCell(52)?.ToString(),
                    PocetUJOcelovychCasti = row.GetCell(53)?.ToString(),
                    PocetUJMasivnychCasti = row.GetCell(54)?.ToString(),
                    CelkovyPocetUJ = row.GetCell(55)?.ToString()
                };

                mostyList.Add(rowData);
            }
        }

        // Now, you can use the mostyList for further processing
        #endregion

        #region Mostnice
        // File path to the Excel file
        filePath = "Mostnice.xls"; // Replace with your actual file path
        List<Mostnice> mostniceList = new List<Mostnice>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(10);


                for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                Mostnice rowData = new Mostnice
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    PoradCisloNK = row.GetCell(7)?.ToString(),
                    DruhMostnic = row.GetCell(8)?.ToString(),
                    Pocet = row.GetCell(9)?.ToString(),
                    MaterialMostnic = row.GetCell(10)?.ToString(),
                    RokPoslednejObnovy = row.GetCell(11)?.ToString(),
                    Poznamka = row.GetCell(12)?.ToString()
                };

                mostniceList.Add(rowData);
            }
        }

        // Now, you can use the mostniceList for further processing
        #endregion

        #region NosneKonstrukcieMost
        // File path to the Excel file
        filePath = "Mosty.xls"; // Always use this file path
        List<NosneKonstrukcieMost> nosneKonstrukcieMostList = new List<NosneKonstrukcieMost>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(8); // Start from sheet index 2

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                NosneKonstrukcieMost rowData = new NosneKonstrukcieMost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    PoradCisloNK = row.GetCell(7)?.ToString(),
                    HodnotenieNK = row.GetCell(8)?.ToString(),
                    NKKod1 = row.GetCell(9)?.ToString(),
                    NKKod2 = row.GetCell(10)?.ToString(),
                    NKKod3 = row.GetCell(11)?.ToString(),
                    NKKod4 = row.GetCell(12)?.ToString(),
                    NKKod5 = row.GetCell(13)?.ToString(),
                    NKKod6 = row.GetCell(14)?.ToString(),
                    EvidOznamenieProvizoria = row.GetCell(15)?.ToString(),
                    KonstrukciaPozdlzDelená = row.GetCell(16)?.ToString(),
                    CislaMostnychPoli = row.GetCell(17)?.ToString(),
                    OsovaVzdialenostHlavnehoNosnika = row.GetCell(18)?.ToString(),
                    RozpetieHlavnehoNosnika = row.GetCell(19)?.ToString(),
                    DlzkaNK = row.GetCell(20)?.ToString(),
                    RozpetiePozdlznikov = row.GetCell(21)?.ToString(),
                    StavebnaVyska = row.GetCell(22)?.ToString(),
                    HmotnostOcelKonstrukcie = row.GetCell(23)?.ToString(),
                    HmotnostStanovena = row.GetCell(24)?.ToString(),
                    SikmostUkoncenia = row.GetCell(25)?.ToString(),
                    RozhodujucaCastNK = row.GetCell(26)?.ToString(),
                    ZatezitelnostNK = row.GetCell(27)?.ToString(),
                    UkoncenieNK = row.GetCell(28)?.ToString(),
                    Loziska = row.GetCell(29)?.ToString(),
                    PodruzneLoziska = row.GetCell(30)?.ToString(),
                    ProtinarazovaZabrana = row.GetCell(31)?.ToString(),
                    MostnyPredpis = row.GetCell(32)?.ToString(),
                    TypHydroizolacieNK = row.GetCell(33)?.ToString(),
                    RokVyrobyNK = row.GetCell(34)?.ToString(),
                    RokZosilneniaOpravyNK = row.GetCell(35)?.ToString(),
                    Poznamka = row.GetCell(36)?.ToString(),
                    CastMosta = row.GetCell(37)?.ToString(),
                    NaterovaPlochaOK = row.GetCell(38)?.ToString(),
                    RokPoslednehoNateruOK = row.GetCell(39)?.ToString(),
                    SposobZisteniaNaterovejPlochaOK = row.GetCell(40)?.ToString(),
                    AgresivitaProstredia = row.GetCell(41)?.ToString(),
                    RozsahAntikoroznejOchrany = row.GetCell(42)?.ToString(),
                    SystemAntikoroznejOchrany = row.GetCell(43)?.ToString(),
                    SposobRozsireniaBetKonstrukcie = row.GetCell(44)?.ToString(),
                    RokRozsirenia = row.GetCell(45)?.ToString()
                };

                nosneKonstrukcieMostList.Add(rowData);
            }
        }

        // Now, you can use the nosneKonstrukcieList for further processing
        #endregion

        #region ObmedzujucePrvkyMost 
        // File path to the Excel file
        filePath = "Mosty.xls"; // Specify your file path
        List<ObmedzujucePrvkyMost> obmedzujucePrvkyMostList = new List<ObmedzujucePrvkyMost>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);

            ISheet sheet = workbook.GetSheetAt(1);
            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                ObmedzujucePrvkyMost rowData = new ObmedzujucePrvkyMost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    ObmedzujuciPrvok = row.GetCell(7)?.ToString(),
                    CelkovaDlzkaM = row.GetCell(8)?.ToString(),
                    VzdialenostOdLavejKrajnejKolajeM = row.GetCell(9)?.ToString(),
                    VzdialenostOdPravejKrajnejKolajeM = row.GetCell(10)?.ToString()
                };
                obmedzujucePrvkyMostList.Add(rowData);
            }
        }
        #endregion

            #region MostnePoliaMost 
        // File path to the Excel file
        filePath = "Mosty.xls"; // Specify your file path
        List<MostnePoliaMost> mostnePoliaMostList = new List<MostnePoliaMost>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);

            ISheet sheet = workbook.GetSheetAt(2);
            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                MostnePoliaMost rowData = new MostnePoliaMost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    PoradoveCislo = row.GetCell(7)?.ToString(),
                    SucetVyskyKolLozkaAPresypavkyM = row.GetCell(8)?.ToString(),
                    KolmaSvetlost = row.GetCell(9)?.ToString(),
                    SikmaSvetlostM = row.GetCell(10)?.ToString(),
                    Poznamka = row.GetCell(11)?.ToString(),
                    TypPrekazky = row.GetCell(12)?.ToString(),
                    BlizsiPopis = row.GetCell(13)?.ToString(),
                    VolnaVyskaNadPrekazkouM = row.GetCell(14)?.ToString(),
                    StorocnyPrietokM3Sek = row.GetCell(15)?.ToString(),
                    PoznamkaDalsia = row.GetCell(16)?.ToString()
                };
                mostnePoliaMostList.Add(rowData);
            }
        }

        #endregion

       #region  CudzieZariadeniaMost 
        // File path to the Excel file
        filePath = "Mosty.xls"; // Specify your file path
        List<CudzieZariadeniaMost> cudzieMostList = new List<CudzieZariadeniaMost>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);

            ISheet sheet = workbook.GetSheetAt(3);
            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                CudzieZariadeniaMost rowData = new CudzieZariadeniaMost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    DruhCudziehoZariadenia = row.GetCell(7)?.ToString(),
                    SpravcaZariadenia = row.GetCell(8)?.ToString(),
                    Poznamka = row.GetCell(9)?.ToString()
                };
                cudzieMostList.Add(rowData);
            }
        }
        #endregion

        #region PoistneUholniky
        // File path to the Excel file
        filePath = "Mosty.xls"; // Specify your file path
        List<PoistneUholnikyMost> poistneUholnikyList = new List<PoistneUholnikyMost>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);

            ISheet sheet = workbook.GetSheetAt(6);
            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                PoistneUholnikyMost rowData = new PoistneUholnikyMost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    TypPoistnehoUholnika = row.GetCell(7)?.ToString(),
                    Dlzka = row.GetCell(8)?.ToString(),
                    Poznamka = row.GetCell(9)?.ToString()
                };
                poistneUholnikyList.Add(rowData);
            }
        }

        #endregion


        #region  KolajeMost 
        // File path to the Excel file
        filePath = "Mosty.xls"; // Specify your file path
        List<KolajeMost> kolajeMostList = new List<KolajeMost>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);

            ISheet sheet = workbook.GetSheetAt(4);
            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                KolajeMost rowData = new KolajeMost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    Cislo = row.GetCell(7)?.ToString(),
                    TU = row.GetCell(8)?.ToString(),
                    DU = row.GetCell(9)?.ToString(),
                    Umiestnenie = row.GetCell(10)?.ToString(),
                    ObmedzujucaRychlost1 = row.GetCell(11)?.ToString(),
                    ObmedzujucaRychlost2 = row.GetCell(12)?.ToString(),
                    KategoriaZatazeniaStZelSpodku = row.GetCell(13)?.ToString(),
                    Zatazitelnost = row.GetCell(14)?.ToString(),
                    Poznamka = row.GetCell(15)?.ToString()
                };
                kolajeMostList.Add(rowData);
            }
        }

            #endregion

        #region  DilatacneZariadeniaMost  
        // File path to the Excel file
        filePath = "Mosty.xls"; // Specify your file path
        List<DilatacneZariadeniaMost> dilatacneMostList = new List<DilatacneZariadeniaMost>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(5);
            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                DilatacneZariadeniaMost rowData = new DilatacneZariadeniaMost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    TypDilatacnehoZariadenia = row.GetCell(7)?.ToString(),
                    Pocet = row.GetCell(8)?.ToString(),
                    Poznamka = row.GetCell(9)?.ToString()
                };
                dilatacneMostList.Add(rowData);
            }
        }
        #endregion

        #region MaterialSpodnejStavbyMost
        // File path to the Excel file
        filePath = "Mosty.xls"; // Specify your file path
        List<MaterialSpodnejStavbyMost> materialSpodnejStavbyList = new List<MaterialSpodnejStavbyMost>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);

            // Parsing MaterialSpodnejStavbyMost from sheet index 3
            ISheet sheet = workbook.GetSheetAt(7);
            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                IRow row = sheet.GetRow(i);
                MaterialSpodnejStavbyMost rowData = new MaterialSpodnejStavbyMost
                {
                    OR = row.GetCell(0)?.ToString(),
                    Spravca = row.GetCell(1)?.ToString(),
                    CisloTU = row.GetCell(2)?.ToString(),
                    CisloDU = row.GetCell(3)?.ToString(),
                    KmPoloha = row.GetCell(4)?.ToString(),
                    JICMosta = row.GetCell(5)?.ToString(),
                    TypMosta = row.GetCell(6)?.ToString(),
                    CastSpodnejStavby = row.GetCell(7)?.ToString(),
                    MaterialCastiSpodnejStavby = row.GetCell(8)?.ToString(),
                    PrefabrikaciaSpodnejStavby = row.GetCell(9)?.ToString(),
                    PopisPrefabrikatu = row.GetCell(10)?.ToString()
                };
                materialSpodnejStavbyList.Add(rowData);
            }
        }
        #endregion

        #region Dilatacne Zariadenia
        // File path to the Excel file
        filePath = "DilatacneZariadenia.xls"; // Replace with your actual file path
        List<DilatacneZariadenia> dilatacneZariadeniaList = new List<DilatacneZariadenia>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                DilatacneZariadenia rowData = new DilatacneZariadenia
                {
                    OR = row.GetCell(0)?.ToString(),
                    SMSU = row.GetCell(1)?.ToString(),
                    TU = row.GetCell(2)?.ToString(),
                    DU = row.GetCell(3)?.ToString(),
                    NazovDU = row.GetCell(4)?.ToString(),
                    KategoriaTrate = row.GetCell(5)?.ToString(),
                    Rozchod = row.GetCell(6)?.ToString(),
                    OznačenieRozchodu = row.GetCell(7)?.ToString(),
                    TriediaciZnak = row.GetCell(8)?.ToString(),
                    PopisTriediacehoZnak = row.GetCell(9)?.ToString(),
                    TypPrevádzky = row.GetCell(10)?.ToString(),
                    CisloKolaje = row.GetCell(11)?.ToString(),
                    IndexKolaje = row.GetCell(12)?.ToString(),
                    KmOd = row.GetCell(13)?.ToString(),
                    KmDo = row.GetCell(14)?.ToString(),
                    Dlzka = row.GetCell(15)?.ToString(),
                    CisloDZ = row.GetCell(16)?.ToString(),
                    KmPoloha = row.GetCell(17)?.ToString(),
                    DlzkaDZ = row.GetCell(18)?.ToString(),
                    KolajnicovyPas = row.GetCell(19)?.ToString(),
                    TypZariadenia = row.GetCell(20)?.ToString(),
                    MiestoZabudovania = row.GetCell(21)?.ToString(),
                    TeplotaPriMontazi = row.GetCell(22)?.ToString(),
                    UpevnenieDZ = row.GetCell(23)?.ToString(),
                    TvarKolajnic = row.GetCell(24)?.ToString(),
                    DruhPodvalov = row.GetCell(25)?.ToString(),
                    TypPodvalov = row.GetCell(26)?.ToString(),
                    KolajoveLozko = row.GetCell(27)?.ToString(),
                    RychlostVHlavnomSmere = row.GetCell(28)?.ToString(),
                    Vyrobca = row.GetCell(29)?.ToString(),
                    DatumVlozenia = row.GetCell(30)?.ToString(),
                    StavPriVlozeni = row.GetCell(31)?.ToString(),
                    KolajovyObvod = row.GetCell(32)?.ToString(),
                    SmerStanicienia = row.GetCell(33)?.ToString(),
                    ZadanieTeplotyPriMontazi = row.GetCell(34)?.ToString(),
                    DatumPoslednejZmeny = row.GetCell(35)?.ToString(),
                    Poznamka = row.GetCell(36)?.ToString()
                };

                dilatacneZariadeniaList.Add(rowData);
            }
        }

        // Now, you can use the dilatacneZariadeniaList for further processing
        #endregion

        #region Tratove Useky
        // File path to the Excel file
        filePath = "TratoveUseky.xls"; // Replace with your actual file path
        List<TratovyUsek> tratoveUsekyList = new List<TratovyUsek>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                TratovyUsek rowData = new TratovyUsek
                {
                    ID = row.GetCell(0)?.ToString(),
                    TracovyUsek = row.GetCell(1)?.ToString(),
                    Od = row.GetCell(2)?.ToString(),
                    Do = row.GetCell(3)?.ToString(),
                    KmOd = row.GetCell(4)?.ToString(),
                    KmDo = row.GetCell(5)?.ToString(),
                    StavebnaDlzka = row.GetCell(6)?.ToString(),
                    RozchodKolaji = row.GetCell(7)?.ToString(),
                    KmTot = row.GetCell(8)?.ToString(),
                    KmTotOd = row.GetCell(9)?.ToString(),
                    DUToznostOd = row.GetCell(10)?.ToString(),
                    KmTotDo = row.GetCell(11)?.ToString(),
                    KmTotDo2 = row.GetCell(12)?.ToString(),
                    DUToznostDo = row.GetCell(13)?.ToString(),
                    Poznamka = row.GetCell(14)?.ToString()
                };

                tratoveUsekyList.Add(rowData);
            }
        }

        // Now, you can use the tratoveUsekyList for further processing
        #endregion

        #region Stanice
        // File path to the Excel file
        filePath = "VnutrostatneBody.xls"; // Replace with your actual file path
        List<VnutrostatnyBod> staniceList = new List<VnutrostatnyBod>();

        using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
        {
            HSSFWorkbook workbook = new HSSFWorkbook(file);
            ISheet sheet = workbook.GetSheetAt(0);

            for (int i = 1; i <= sheet.LastRowNum; i++) // Start from row 1 to skip headers
            {
                IRow row = sheet.GetRow(i);

                VnutrostatnyBod rowData = new VnutrostatnyBod
                {
                    Skratka = row.GetCell(0)?.ToString(),
                    GPSN = row.GetCell(1)?.ToString(),
                    GPSE = row.GetCell(2)?.ToString(),
                    PolohaX = row.GetCell(3)?.ToString(),
                    PolohaY = row.GetCell(4)?.ToString(),
                    Email = row.GetCell(5)?.ToString(),
                    TelefonZeleznicnaSiet = row.GetCell(6)?.ToString(),
                    TelefonVerjnaSiet = row.GetCell(7)?.ToString(),
                    LenPreISZSR = row.GetCell(8)?.ToString(),
                    InaDraha = row.GetCell(9)?.ToString(),
                    Obec = row.GetCell(10)?.ToString(),
                    VystupNastupCestujucich = row.GetCell(11)?.ToString(),
                    PriznakExistencieNastupist = row.GetCell(12)?.ToString(),
                    Poznamka = row.GetCell(13)?.ToString()
                };

                staniceList.Add(rowData);
            }
        }

        // Now, you can use the staniceList for further processing
        #endregion


    }

}
