Ejemplo n.º 1
0
        private void GenerateXmlButtonHandler(object sender, EventArgs e)
        {
            try
            {
                TravelAgencyDbContext dbContext = new TravelAgencyDbContext();
                XMLGenerator xmlGenerator = new XMLGenerator();

                var cb1Value = this.destinationsComboBox.SelectedValue.ToString();
                var cb2Value = this.guidesComboBox.SelectedValue.ToString();
                var cb3Value = this.transportsComboBox.SelectedValue.ToString();
                xmlGenerator.XmlGenerate(dbContext, cb1Value, cb2Value, cb3Value);
                MessageBox.Show("XML document was generated successfully with the data from SQL!");
            }
            catch (Exception)
            {
                MessageBox.Show("XML document couldn't be generated!");
            }
        }
Ejemplo n.º 2
0
 private void ImportFromSqlToXml(object sender, EventArgs e)
 {
     TravelAgencyDbContext dbContext = new TravelAgencyDbContext();
     XMLGenerator xmlGenerator = new XMLGenerator();
     this.GenerateXmlButtonHandler(sender, e);
 }