Beispiel #1
0
 /// <summary>
 /// Сохранение таблицы в xml-файл
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MenuItemSave_Click(object sender, EventArgs e)
 {
     if (SaveFileDialog.ShowDialog() == DialogResult.OK)
     {
         XmlWorker.WriteFlights(ExportFlights(), SaveFileDialog.FileName);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Открыть таблицу из xml-файла
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MenuItemOpen_Click(object sender, EventArgs e)
        {
            if (OpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                var flights = XmlWorker.GetFlights(OpenFileDialog.FileName);

                DataGrid.Rows.Clear();
                foreach (var flight in flights)
                {
                    AppendFlight(flight);
                }
            }
        }