Esempio n. 1
0
        public void UpdateDataBank()
        {
            isExceptionUnhandled = false;
            int filesCounter = 0;

            if (isInputCsvFileAvailable())
            {
                while (isInputCsvFileAvailable())
                {
                    if (TryUpdateSavedXml(PathToFilesUtil.GetNameInputCsvFile()))
                    {
                        PathToFilesUtil.MoveFileToArxiv();
                        filesCounter++;
                    }
                }
            }
            else
            {
                PathToFilesUtil.CreateSskaFolderAndFile();
            }
            MessageBox.Show("Update is completed. It was processed " + filesCounter + (filesCounter == 1 ? " file." : " files."), Config.AppName, MessageBoxButton.OK, MessageBoxImage.Information);
        }
Esempio n. 2
0
 public CsvToXmlSSKA()
 {
     PathToStorageXmlFile = Config.PathToXmlStorageFolder + @"\" + Settings.Default.StorageFileName;
     try
     {
         if (File.Exists(PathToStorageXmlFile))
         {
             DataSource = XElement.Load(PathToStorageXmlFile);
         }
         else
         {
             DataSource = XElement.Load(PathToFilesUtil.CreateSskaFolderAndFile());
             MessageBox.Show("The data bank file is empty.", Config.AppName, MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message, Config.AppName + ": Xml Storage File was not load!", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     //finally
     //{
     //    DataSource = null;
     //}
 }