Beispiel #1
0
        private void ReadLabels()
        {
            this.helper.SelectDatabase();

            LabelReader2 labelReader = new LabelReader2(this.config.LabelsXmlPath);

            foreach (Label label in labelReader.Enumerate())
            {
                this.progressReporter.Report("Labels", labelReader.EstimatedProgress);
            }
            this.progressReporter.Report("Labels", -1);
        }
Beispiel #2
0
        private void ImportLabels()
        {
            this.helper.SelectDatabase();

            LabelReader2  labelReader   = new LabelReader2(this.config.LabelsXmlPath);
            LabelInserter labelInserter = new LabelInserter(this.config.Conn);

            foreach (Label label in labelReader.Enumerate())
            {
                try
                {
                    labelInserter.Insert(label);
                }
                catch (MySqlException ex)
                {
                    Console.WriteLine("Error importing label " + label.Id + ": " + ex.Message);
                }

                this.progressReporter.Report("Labels", labelReader.EstimatedProgress);
            }
            this.progressReporter.Report("Labels", -1);
        }