Beispiel #1
0
        private void exportTablebtn_Click(object sender, EventArgs e)
        {
            if (this.table != null)
            {
                explorer.FileName = "export_" + this.table + ".xml";
                DialogResult dr = explorer.ShowDialog();

                if (dr == DialogResult.OK)
                {
                    string xml = dbxml.tableToXml(this.table);

                    if (DBtoXML.WriteXmlStringToFile(explorer.FileName, xml))
                    {
                        Alert.Info("Se ha exportado " + this.table + " a " + explorer.FileName);
                        this.OpenFile(explorer.FileName);
                    }
                    else
                    {
                        Alert.Warning("Fallo al exportar " + this.table);
                    }
                }
            }
            else
            {
                Alert.Warning("Debes seleccionar una tabla!");
            }
        }
Beispiel #2
0
        private void exportar()
        {
            for (int i = 0; i < this.tablesExport.Count; i++)
            {
                string path      = this.SelectedPath + "\\" + this.tablesExport[i] + ".xml";
                string xmlString = this.dbxml.tableToXml(this.tablesExport[i]);

                if (xmlString != null && xmlString != "")
                {
                    DBtoXML.WriteXmlStringToFile(path, xmlString);
                }
            }
        }
Beispiel #3
0
        private void exportAllBtn_Click(object sender, EventArgs e)
        {
            explorer.FileName = "export_" + this.database + ".xml"; // nombre por defecto del xml que exportamos
            DialogResult dr = explorer.ShowDialog();

            if (dr == DialogResult.OK)
            {
                string xml = dbxml.tablesToXml(this.database);
                if (DBtoXML.WriteXmlStringToFile(explorer.FileName, xml))
                {
                    Alert.Info("Se han exportado todas las tablas a " + explorer.FileName);
                    this.OpenFile(explorer.FileName);
                }
                else
                {
                    Alert.Warning("Fallo al exportar todas las tablas");
                }
            }
        }