Example #1
0
        //XML exportolasa a kivalasztott szoveg alapjan a kivalasztott fileba
        //automatikusan general melle egy ugyanolyan nevu HTML file-t is, XSLT hasznalataval
        private void btnExport_Click(object sender, EventArgs e)
        {
            string file = tbFileLocationExport.Text;

            if (file.Equals("") || file.EndsWith("\\"))
            {
                file += "<fname>";
            }
            if (!file.Contains(":"))
            {
                file = "C:\\Users\\" + Environment.UserName + "\\Desktop\\" + file;
            }
            if (!file.EndsWith(".xml"))
            {
                file += ".xml";
            }
            if (cbExport.SelectedIndex == 0)
            {
                vehicles.ExportVehiclesXML(file.Replace("<fname>", "VehiclesExport"));
            }
            if (cbExport.SelectedIndex == 1)
            {
                loans.ExportLoansXML(file.Replace("<fname>", "LoansExport"));
            }
            if (cbExport.SelectedIndex == 2)
            {
                users.ExportUsersXML(file.Replace("<fname>", "UsersExport"));
            }
            MessageBox.Show("Az exportálás befejeződött.");
        }