// check of file extension, save the file, load data from CSV file
        public string ReadFromCSVformatAndSaveIntoXMLformat(HttpPostedFileBase fileInCSVformat)
        {
            bool fileCheck = CheckFileExtension(fileInCSVformat.FileName);

            if (!fileCheck)
            {
                return("Chyba. Vstupní soubor není typu CSV");
            }

            inputFilePath = WorkingWithInputAndOutputFiles.SaveInputFile(fileInCSVformat);

            if (inputFilePath.Contains("Chyba"))
            {
                return(inputFilePath);
            }

            string result = GetDataFromCSVformat(ref columnNames, ref data);

            if (result.Contains("Chyba"))
            {
                return(result);
            }

            outputFilePath = SaveIntoXMLformat();

            if (outputFilePath.Contains("Chyba"))
            {
                return(outputFilePath);
            }

            return(outputFilePath);
        }
        // save loaded data into XML file
        private string SaveIntoXMLformat()
        {
            outputFilePath = WorkingWithInputAndOutputFiles.GetPathForXMLfile();

            if (outputFilePath.Contains("Chyba"))
            {
                return(outputFilePath);
            }

            try
            {
                XDocument document         = new XDocument(new XDeclaration("1.1", "utf-8", null), new XElement("Data"));
                int       columnIndex      = 0;
                int       columnNamesCount = columnNames.Count;

                foreach (string value in data)
                {
                    document.Element("Data").Add(new XElement("DataRow", new XElement(columnNames[columnIndex], value)
                                                              )
                                                 );

                    if (columnIndex + 1 == columnNamesCount)
                    {
                        columnIndex = 0;
                    }

                    else
                    {
                        columnIndex++;
                    }
                }
                document.Save(outputFilePath);

                return(outputFilePath);
            }
            catch (Exception ex)
            {
                return($"Chyba. Uložení dat do XML souboru se nepodařilo. Popis chyby: \n\n {ex.Message.ToString()}");
            }
        }